This content has been marked as final. Show 6 replies
There is no conflict between using attachMovie and loading content dynamically. I do it all the time.
load your data
attach your clip
populate it with the data
Move on to the next one.
The restriction I have is that the state of the movieClip that I want to duplicate does not exist in my library if you imagine I have MovieClips "A" and "B" and inside of MovieClip "A" there is MovieClip "C" I will load a image into MovieClip "C" now the problem comes into play
I need to duplicate MovieClip "C" in its current state with the loaded image into MovieClip "B". so that MovieClip "B" does not get replaced but insted gets a child MovieClip of the duplicated MovieClip.
Not sure if Im explaining this very clearly if there is anything I can specify please let me know
I took a look at the duplicatMovieClip functionality and it seemed iffy. It says that variables in the original clip will not be carried to the new clip.
I think I understand what you are after and i think I would still use attachMovie.
I would create a clip in the library to use for attaching. Then you can target whatever container you want.
I Understand that you are building the the clip you want with data and what you need to do is to duplicate the clip in whatever state it happens to exist in at the time you want to duplicate it. But, you have the data. Each time you populate a clip with its data, hang on to that data as the seed data for the new clip you are going to create with attachMovie.
So instead of duplicating to clip in the state its in, save the data you used to cause it to be in the state it is in and use feed that data to the new clip so it assumes the state of the other clip.
Am I making sense?
Yes thats making perfect sense I really appreciate your post. The problem Im having is that the "data" im loading is JPG, PNG or SWF and trying to get that "data" into another MovieClip with out having to reload the external assets.
Thanks again Im starting to wonder if this is possible or not
Content that was loaded dynamically won't be duplicated by the duplicateMovieClip() method and therefore can't be transferred. Besides that, it's just not possible to duplicate MCs into another parent, only into the parent of the original MC.
So as already mentioned, try to use attachMovie() instead. For the loaded content, there are 2 ways:
- just load it again, Flash should use the cache if it isn't disabled, so it shouldn't load it from the net again. Or
- create a bitmap copy of the loaded content and attach it to another MC. This can duplicate the visual content of your MC, but not the functionality. It will eat some ressources too (32 bits per pixel).
var picture:BitmapData = new BitmapData(yourMC._width, yourMC._height);
Thanks for the help I guess attachMovie and reloading the content isnt that bad if its coming from the cache I will have to play with it a little to see what kind of delays can pop up before the content shows but anyways thanks again