-
Empty Movie Clips Question...
if i am loading .swf's into an empty movie clip or to into level 0, does flash automatically remove the existing movie? Or do I have have to remove it using actionscript?
-
Sonic the FlashHog
first, i believe you cant load movies onto level0 (because thats where your _root timeline exists - but dont quote me!), it has to be 1 or higher. and theres an unload movie function to remove whatever loaded movie was in its place...
Code:
on (press) {
unloadMovie ("_root.draggable");
loadMovieNum ("movie.swf", 4);
}
would be a good example
hope that helps a little...
geoff
Moving at the speed of Flash
-
as far as i know, it removes it automatically. check my www link for a demo of using a placeholder
-
Sonic the FlashHog
no, it wont remove them automatically
*EDIT*
Ok, I guess if you load one directly into the other, it will replace its timeline as the primary timeline.
*apologies*
Last edited by geoffp08; 05-01-2003 at 12:48 PM.
Moving at the speed of Flash
-
FK's Geezer Mod
No two objects can occupy the same space at the same time. If you load swf's into an empty clip or a level, including _level0, it will replace what's there. Or rather the loaded swf will 'become' the empty clip or level. One real easy way to remove a swf from an empty clip is to use this code:
on(release){
_root.mtClip.loadMovie("");
}
-
Sonic the FlashHog
huh? not sure i followed that...
Moving at the speed of Flash
-
FK's Geezer Mod
Which part?
If you load movie1.swf into an empty clip using loadMovie, then click another button to load movie2.swf into the same empty clip, movie1 is gone, replaced by movie2.
Same thing with levels. If you load movie1 to level1, then load movie2 to level1, movie1 is just replaced.
If you load a movie to the root, the loaded movie replaces the root movie. Not much good for anything, unless you wanted to change the fps rate or size of the main movie without going to a new html page.
And this little piece of code works very well to clear the stage of any movie that may be loaded into that empty movie clip. It doesn't look like it should work, but it does:
on(release){
_root.mtClip.loadMovie("");
}
What I meant by a movie 'becomes' the clip or level it's loaded into is in the sense that when you want to target that loaded movie, you don't target movie1.swf, you target _root.mtClip or _level1. movie1.swf has become mtClip or _level1.
Last edited by iaskwhy; 05-01-2003 at 02:49 PM.
-
Sonic the FlashHog
yeah, OK. thats what I thought... just threw me off a bit while I looked at it!
geoff
Moving at the speed of Flash
-
If you load a movie number
loadMovieNum("test.swf", 1);or (2)
You unload with
uloadMovieNum(1); (or 2)
If you load a movie into a target
loadMovie("test.swf, "mytargetname");
you unload with
unloadMovie("mytargetname");
You cannot load with a level of 0. you have to think of it as level 1 2 3 ... level 1 will be behind level 2 and level 2 will be behind level three. Level 0 can load but will not unload the level 0 is a non valued number. start with a level 1 and work your way up. give each movie a different level but when you load a movie besure to unload any movie levels that have been loaded.
on(release) {
//This below does not have to be on a button it may load with a frame
unloadMovieNum(1);
loadMovieNum("test2.swf", 2);
stop();
}
Last edited by ishoy; 05-01-2003 at 03:24 PM.
Ishoy
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|