ej --
Another possible approach is to use MovieClipLoader() with
createEmptyMovieClip() and loadClip() to create a child movieclip nested
within a parent movieclip. I posted steps for doing this on May 1, in
response to the posting "dynamic image loading in mc".
-- Bob Hadsell
From: ej <[EMAIL PROTECTED]>
Reply-To: [email protected]
To: [email protected]
Subject: [Flashcoders] MovieClip.loadMovie(), unloadMovie() and
attachMovie()
Date: Wed, 9 May 2007 21:44:52 +0000 (UTC)
I am rather new to Flash and ActionScript. I think maybe I am not quite
understanding how I should properly being using these functions and hoping
someone can enlighten me.
I am trying to write a general sort of player. I have an empty MovieClip
placeholder on the stage (let's call it 'mc') I want to be able to load
content
into and then replace with other content.
Sometimes what I want to load in an external SWF file, and sometimes I
want
to load a MovieClip that is within the library of my top-level movie. I
don't
have any problem doing this:
mc.loadMovie('myMovie.swf');
// detect end of that movie, then:
mc.unloadMovie();
mc.loadMovie('myMovie.swf'); // just run same one again
So, mc is still there after unloadMovie() and I can load and play the
same
thing again using the same stage instacne. I also don't have any problem
doing
this:
mc.attachMovie('myLinkIdentifier', 'myInstanceName',
mc.getNextHighestDepth());
// detect end of that movie, then:
mc.attachMovie('myLinkIdentifier', 'myInstanceName',
mc.getNextHighestDepth());
(I realize the code above is creating more instance on top of one
another and
using up more memory. That's fine - I have seen the animation example (Tofu
Hunter) that came with it. The important part is that I can still attach a
symbol after having already done so.)
What I can't seem to get working the way I would expect is to be able to
load
a SWF, then unload it, then attach a library MovieClip symbol to the same
placeholder. Something like this:
mc.loadMovie('myMovie.swf');
// detect end of that movie, then:
mc.unloadMovie();
mc.attachMovie('myLinkIdentifier', 'myInstanceName',
mc.getNextHighestDepth());
Maybe there's some logical reason to not be able to do this, but I guess
I'm
just not seeing it. Can someone please explain this in a little more
detail?
Thanks,
-ej
_______________________________________________
[email protected]
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
_________________________________________________________________
More photos, more messages, more storageget 2GB with Windows Live Hotmail.
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_2G_0507
_______________________________________________
[email protected]
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