|
-
Developing For Dunkets
instead of using loadMovie you can use the MovieClipLoader class that has the onLoadInit function that checks if an external swf is loaded including it's actions.
var mcl:MovieClipLoader = new MovieClipLoader;
choice = Math.round(Math.random()*2);
switch (choice) {
case 0 :
location.loadClip("image0.swf");
break;
case 1 :
location.loadClip("image1.swf");
break;
case 2 :
location.loadClip("image2.swf");
break;
default ://add a default in case the switch fails for some reason
location.loadClip("image0.swf");
break;
}
mcl.onLoadInit = function(){
//add the actions you want to happen when the movie is loaded
}
mcl.addListener(this);
Last edited by mneil; 08-28-2007 at 01:51 PM.
Reason: you should add a default to your switch
-
Thanks for your help!
I tried the code you provided, and I received an error saying "there is no property with the name 'onloadInit'.
Do you know what the problem is?
Thank you!
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
|