Francesco: I think that, by creating a new property on movieclip "a" and referencing it to the b_copy_child (which in turn references "copy" in movieclip "b") would only allow you to control the "copy" movieclip located into movieclip "b".
I don´t have flash here so I can´t test anything and I´m just curious about (as it has been quite some time since the last time I used duplicateMovieClip) if this would work: _root.duplicateMovieClip(_root.movieclip_b.mymc,"mycopiedclip",1); Would this code create a instance of the movieclip mymc into _root? - Marcelo. On 5/5/06, August Gresens <[EMAIL PROTECTED]> wrote:
Francesco - I'll give that a try. It actually occurred to me, but I didn't try it because I wasn't sure how the depth would be handled and what issues would be associated with having a single clip instance be the child of two parents. (When you move "b", does it also move in "a", even if "a" is not moved?) Thanks, August On 5/5/06, Francesco <[EMAIL PROTECTED]> wrote: > > Provided you know the child-to-copy instance name, that's a workaround: > > say you have 2 mcs, one (a) created in your project and one (b) loaded > externally. > say you know the desired b-child instance name (b_child): > > //create a copy of the desired child > var b_copy_child:MovieClip = > b_child.duplicateMovieClip("copy",b.getNextHighestDepth()); > > /* > * then 2 ways: > * a) if you simply want a reference to use in your project, work with > b_copy_child; > * b) if you really want b_child instance to be a child of a, > reference it from within, > * thanks to the fact MovieClip is dynamic: > */ > > a.a_child = b_copy_child; > > This, unless I'm missing some more-DOM-like AS2 interfaces - and then > I'd love to hear about.. > HTH > francesco.p > > August Gresens wrote: > > Thanks much for your previous responses, very helpful. > > > > One more question - how can I duplicate or attach a child clip of one > > clip > > into another clip? > > > > For example, if I have two clips on the timeline, can I somehow copy the > > first child of one clip into another? > > > > DuplicateMovieClip does not seem to provide this functionality. It seems > > only allow you to create a duplicate that is attached to the same parent > > clip. I want to be able to copy child clips from my loaded external > clip, > > into various clips in my project. > > > > Thanks, > > > > August > > > > On 5/5/06, Francesco <[EMAIL PROTECTED]> wrote: > >> > >> Really don't know if is there a way to load a .fla asset (such as a > >> Library) into an swf.. > >> > >> but sure you can use an external swf as a content library, as long as > >> all library items (children mcs): > >> - can be referenced by instance name (which is to be set on the > external > >> .fla) > >> - are not referenced by instance name, but can be univocally retrieved > >> by any other means (e.g. property values) > >> > >> once acquired desiredChildMovieClip, you can duplicate it on your > >> project. > >> HTH > >> francesco > >> > >> > >> > >> > >> August Gresens wrote: > >> > I guess what I'm looking for is an alternative to the clunky "Shared > >> > Library" thing they've got set up. I"m seeing now, however, that even > >> > if I > >> > get this working, there would be no way to duplicate the externally > >> > loaded > >> > swf's child to a clip in my main project (right?). In essence, I want > >> > to be > >> > able to use the externally loaded clip as a library - but it is > >> > starting to > >> > dawn on me that this is not possible (?). > >> > > >> > (By the way, I'm mystified that the "Shared Library" has been > >> implemented > >> > the way that it has - the url requirement would seem to make it > >> > difficult to > >> > arbitrarily load external libraries into a movie without manually > >> > changing > >> > the URL properties in the IDE. It would be great if you could just > >> > load an > >> > external library the way we do external clips). > >> > > >> > Thanks, > >> > > >> > August > >> > > >> > On 5/5/06, Francesco <[EMAIL PROTECTED]> wrote: > >> >> > >> >> if I got correctly the point, you're asking: > >> >> can I access children of an external swf loaded at any level into my > >> >> project via MovieClip.loadMovie() or MovieClipLoader.loadClip()? > >> >> If not, sorry for bothering > >> >> If yes, I think: sure you can, as long as you know their instance > >> name. > >> >> If you don't, you'll have to work them out: > >> >> > >> >> loadedMovie.loadMovie("externalSwf.swf"); > >> >> > >> >> /* > >> >> * now loadedMovie and externalSwf timelines overlap; if you know the > >> >> child's instance name the work is done. > >> >> * if you don't I'll do like this (but chances are ways are better > >> than > >> >> this one): > >> >> * try to provide some <test_code> that lets you find in a not > >> ambiguos > >> >> way the desired child mc among other children mcs > >> >> */ > >> >> > >> >> var desiredChildMovieClip:MovieClip; > >> >> for (var i in loadedMovie) { > >> >> if(test_code) { > >> >> desiredChildMovieClip = loadedMovie[i]; > >> >> } > >> >> } > >> >> > >> >> /* > >> >> * so desiredChildMovieClip is the child you were looking for. > >> >> * if there's no such <test_code> thing, sorry I have no idea.. > >> >> */ > >> >> > >> >> HTH > >> >> francesco.p > >> >> > >> >> Jim Tann wrote: > >> >> > You need to import one movieclip from the child swf into the > parent > >> >> > swf's library & have it placed on the stage / inside a movieclip > >> >> that is > >> >> > exported for actionscript to have access to all of the elements in > >> the > >> >> > child swf's library. > >> >> > > >> >> > Jim > >> >> > > >> >> > -----Original Message----- > >> >> > From: [EMAIL PROTECTED] > >> >> > [mailto:[EMAIL PROTECTED] On Behalf Of > >> August > >> >> > Gresens > >> >> > Sent: 05 May 2006 02:43 > >> >> > To: Flashcoders mailing list > >> >> > Subject: [Flashcoders] newbie: nested clips and LoadMovie > >> >> > > >> >> > Hello > >> >> > > >> >> > Is it possible to access (duplicate and use) clips nested inside > >> >> another > >> >> > clip you've loaded into a movie via LoadMovie (or using the > >> >> > MovieClipLoader). > >> >> > > >> >> > For example, if I want to maintain a clip external to my main > flash > >> >> > project > >> >> > that has a bunch of misc graphics - after I've loaded this > external > >> >> > clip, > >> >> > can I duplicate these graphics somehow and attach them to clips in > >> the > >> >> > main > >> >> > project? The purpose of this would be to load all of these > graphics > >> >> all > >> >> > in > >> >> > one shot, as opposed to loading them individually. > >> >> > > >> >> > >From playing around with it - it seems as though the loaded > >> clip is > >> >> > treated > >> >> > as an independent media element, with no access to it's > >> children. Is > >> >> > this > >> >> > correct? > >> >> > > >> >> > Thanks, > >> >> > > >> >> > August > >> >> > _______________________________________________ > >> >> > Flashcoders@chattyfig.figleaf.com > >> >> > To change your subscription options or search the archive: > >> >> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > >> >> > > >> >> > Brought to you by Fig Leaf Software > >> >> > Premier Authorized Adobe Consulting and Training > >> >> > http://www.figleaf.com > >> >> > http://training.figleaf.com > >> >> > > >> >> > > >> >> > _______________________________________________ > >> >> > Flashcoders@chattyfig.figleaf.com > >> >> > To change your subscription options or search the archive: > >> >> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > >> >> > > >> >> > Brought to you by Fig Leaf Software > >> >> > Premier Authorized Adobe Consulting and Training > >> >> > http://www.figleaf.com > >> >> > http://training.figleaf.com > >> >> > > >> >> > > >> >> _______________________________________________ > >> >> Flashcoders@chattyfig.figleaf.com > >> >> To change your subscription options or search the archive: > >> >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > >> >> > >> >> Brought to you by Fig Leaf Software > >> >> Premier Authorized Adobe Consulting and Training > >> >> http://www.figleaf.com > >> >> http://training.figleaf.com > >> >> > >> > > >> > > >> > > >> > -- > >> > --------------------------------------------------------- > >> > -------------------------------------------------------- > >> > > >> > August Gresens > >> > Technical Director > >> > Black Hammer Productions, NYC > >> > [EMAIL PROTECTED] > >> > > >> > --------------------------------------------------------- > >> > -------------------------------------------------------- > >> > _______________________________________________ > >> > Flashcoders@chattyfig.figleaf.com > >> > To change your subscription options or search the archive: > >> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > >> > > >> > Brought to you by Fig Leaf Software > >> > Premier Authorized Adobe Consulting and Training > >> > http://www.figleaf.com > >> > http://training.figleaf.com > >> > > >> _______________________________________________ > >> Flashcoders@chattyfig.figleaf.com > >> To change your subscription options or search the archive: > >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > >> > >> Brought to you by Fig Leaf Software > >> Premier Authorized Adobe Consulting and Training > >> http://www.figleaf.com > >> http://training.figleaf.com > >> > > > > > > > > -- > > --------------------------------------------------------- > > -------------------------------------------------------- > > > > August Gresens > > Technical Director > > Black Hammer Productions, NYC > > [EMAIL PROTECTED] > > > > --------------------------------------------------------- > > -------------------------------------------------------- > > _______________________________________________ > > Flashcoders@chattyfig.figleaf.com > > To change your subscription options or search the archive: > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > Brought to you by Fig Leaf Software > > Premier Authorized Adobe Consulting and Training > > http://www.figleaf.com > > http://training.figleaf.com > > > _______________________________________________ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com > -- --------------------------------------------------------- -------------------------------------------------------- August Gresens Technical Director Black Hammer Productions, NYC [EMAIL PROTECTED] --------------------------------------------------------- -------------------------------------------------------- _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
_______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com