A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: How to make sure randomly loaded externals swfs are fully loaded [F8]

Threaded View

  1. #2
    Developing For Dunkets mneil's Avatar
    Join Date
    Mar 2007
    Location
    Lincoln City
    Posts
    2,156
    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
    http://code.mneilsworld.com/
    Text Effects | Bubbles | Dynamic Resize
    4 weeks , 20 papers ... thats 2 dollars .....Caassshhh!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center