A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Removing Loaded swf...

Threaded View

  1. #6
    lemon juice hurts your eyes florianvanthuyn's Avatar
    Join Date
    Jul 2005
    Location
    Merelbeke, Belgium
    Posts
    546
    For the different names you can use an Array:
    PHP Code:
    var currSWF:uint 1;
    var 
    movLoader:Loader;
    // so store the names in here, no .swf needed
    var swfNames:Array = ["firstName","secondDifferentName","otherTitle","someSWF"];
    var 
    swfs:Array = new Array();

    function 
    loadSWF():void
    {
       
    movLoader = new Loader();
       
    // we take one of the objects in the Array using the currSWF variable as index
       
    movLoader.load(new URLRequest(swfNames[currSWF] + ".swf")); // will load in one SWF
       
    moveLoader.contentLoaderInfo.addEventListener(Event.COMPLETESWFComplete);

       
    currSWF++; // increace one time for the next round
    }

    function 
    SWFComplete(e:Event):void
    {
       var 
    swf:MovieClip e.currentTarget.content;
       
    swfs.push(swf); // storing them, not adding them -> easier later

       
    if(currSWF 8loadSWF(); // go for another round
       
    else
       {
          
    activateBtns(); // everything is loaded, time to activate the btns
          
    currSWF 0;
       }

    Should work I guess

    Are your buttons on that same frame as where you put the code? Try putting a trace inside of clickHandler() I posted a while ago and comment out all the other code in there to see if they really aren't doing anything.

    EDIT: If your buttons have different names than Button0, Button1, etc than you'll have to use another Array as I used above for the buttons too!
    Last edited by florianvanthuyn; 08-22-2009 at 04:40 AM.
    Florian Vanthuyne

    WAR AGAINST SOLVED THREADS
    mark yours as Resolved under Thread Tools!

Tags for this Thread

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