actionscript 3.0 help needed

Discussion in 'Software' started by Shadowchaser, May 12, 2009.

  1. Shadowchaser

    Shadowchaser A Really Great Guy

    Having some serious problems with unloading the external .swf movies I'm
    using in my website. I have yet to find a solution for this and it's
    down to crunch time so if anyone has any ideas I'm definitely open to
    them (this is the same problem I had with Project #2 and I discussed
    with Phil at that time). Here is the code I'm using to load the movies
    when the link is clicked for the movie:

    function link(event:MouseEvent):void
    {
    var linkLoad:Loader = new Loader();
    linkLoad.load(new URLRequest(event.target.name + ".swf"));
    addChild(linkLoad);
    linkLoad.x = 150;
    linkLoad.y = 200;
    }

    //DisplayObjectContainer.removeChild(linkLoad);


    introtext.addEventListener(MouseEvent.CLICK,link);
    //ca.addEventListener(MouseEvent.CLICK,link);
    cod5.addEventListener(MouseEvent.CLICK,link);
    eq2.addEventListener(MouseEvent.CLICK,link);
    WoW.addEventListener(MouseEvent.CLICK,link);

    introtext.buttonMode = true;
    //ca.buttonMode = true;
    cod5.buttonMode = true;
    eq2.buttonMode = true;
    WoW.buttonMode = true;


    This is loading just fine but my problem lies in when you click another
    link. If you click the introtext link it will play the movie but if you
    don't wait for the movie to end and click the cod5 link the new movie
    will load and superimpose itself over the introtext movie. This is very
    frustrating! unloadMovie is not supported in AS3 and I've tried a
    variety of level commands to remove the movie from level 0 of the
    container. I'm really at a loss here and have found nothing through a
    google search that has helped me.

    I am using Flash CS4 and yes this is for my final but even the instructor does not know how to accomplish the unloading of the movies. Makes me kind of wonder.......

    as you can see I've tried the "DisplayObjectContainer.removeChild(linkLoad);" that I've commented out of the script above and I also attempted "stage.removeChildAt(0);" which is the replacement for the unloadMovieNum(0) which was in AS2.0. If anyone has any ideas I would be eternally grateful!

    Yours,
    Jack
     
  2. Cat_w_9_lives

    Cat_w_9_lives Major KittyCat

    Last edited: May 13, 2009

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds