A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Swf Library + FLV'S won't stop playing when swf is unloaded!

  1. #1
    Member
    Join Date
    Sep 2008
    Posts
    39

    Swf Library + FLV'S won't stop playing when swf is unloaded!

    I have a Holder swf. This swf loads up a bunch of different swfs that contain video.

    My problem is when i switch out the swfs the flv keeps streaming int he background and you can hear the sound even though it's not there anymore!

    It seems like i have tried everything

    I hope my code makes sense,
    this is the code for the "HOLDER" as i call it. it works great! except the flv's still stream in the background when the swf with the flv isn't running anymore! i have an empty movie clip on the stage called 'box' that loads the swfs.

    i need something like stop all streaming or something i don't know
    thank you so much

    var myQueryStrings=this.loaderInfo.parameters;
    box.URL=myQueryStrings.feature;


    var myLoader:Loader = new Loader();
    var myURL:URLRequest = new URLRequest(myQueryStrings.feature);
    myLoader.load(myURL);



    box.addChild(myLoader);
    box.x = 0;
    box.y = 0;


    mc_2008.video1_btn.addEventListener(MouseEvent.CLI CK, video1Clicked);
    mc_2008.video2_btn.addEventListener(MouseEvent.CLI CK, video2Clicked);
    mc_2008.video3_btn.addEventListener(MouseEvent.CLI CK, video3Clicked);
    mc_2008.video4_btn.addEventListener(MouseEvent.CLI CK, video4Clicked);
    mc_2008.yandf_btn.addEventListener(MouseEvent.CLIC K, yandfClicked);
    mc_2009.MessiaenAndBerlioz_btn.addEventListener(Mo useEvent.CLICK, mandBClicked);
    mc_2009.MessiaenandBerlioz2.addEventListener(Mouse Event.CLICK, mandB2Clicked);
    mc_2009.verdi09.addEventListener(MouseEvent.CLICK, verdi09Clicked);
    mc_2009.ives09.addEventListener(MouseEvent.CLICK, ives09Clicked);

    //09/10 EVENT LISTENERS
    beethoven_mc.addEventListener(MouseEvent.CLICK, beethovenClicked);
    macmillan_mc.addEventListener(MouseEvent.CLICK, macmillanClicked);

    //09/10 BUTTONS
    macmillan_mc.buttonMode=true;
    beethoven_mc.buttonMode=true;

    //URL's
    var myURL2:URLRequest = new URLRequest("/images/ClassicalCompanionNew/JohnHarbison/JohnHarbisonNew.swf");
    var myURL3:URLRequest = new URLRequest("/images/CLassicalCompanionNew/WilliamBolcom/WilliamBolcomNew.swf");
    var myURL4:URLRequest = new URLRequest("/images/ClassicalCompanionNew/ElliottCarter/elliottcarterNew.swf");
    var myURL5:URLRequest = new URLRequest("/images/ClassicalCompanionNew/HenriDutilleux/henridutilleuxNew.swf");
    var myURL6:URLRequest = new URLRequest("/images/ClassicalCompanionNew/YouthAndFamily/Youthandfamily.swf");
    var myURL7:URLRequest = new URLRequest("/images/ClassicalCompanionNew/20081023/20081023.swf");
    var myURL8:URLRequest = new URLRequest("/images/ClassicalCompanionNew/20081128/20081128.swf");
    var myURL9:URLRequest = new URLRequest("/images/ClassicalCompanionNew/verdi09/Verdi09akamai.swf");
    var myURL10:URLRequest = new URLRequest("/images/ClassicalCompanionNew/ives09/ives2009.swf");
    var myURL11:URLRequest = new URLRequest("/images/ClassicalCompanionNew/beethoven_2009/beethoven_2009.swf");
    var myURL12:URLRequest = new URLRequest("/images/ClassicalCompanionNew/macmillan_2010/macmillan_2010.swf");

    function video1Clicked(event:MouseEvent):void {
    myLoader.load(myURL2);
    SoundMixer.stopAll();


    }

    function video2Clicked(event:MouseEvent):void {
    myLoader.load(myURL3);
    SoundMixer.stopAll();

    }

    function video3Clicked(event:MouseEvent):void {
    myLoader.load(myURL4);

    SoundMixer.stopAll();

    }

    function video4Clicked(event:MouseEvent):void {
    myLoader.load(myURL5);

    SoundMixer.stopAll();

    }
    function yandfClicked(event:MouseEvent):void {
    myLoader.load(myURL6);

    SoundMixer.stopAll();

    }
    function mandBClicked(event:MouseEvent):void {
    myLoader.load(myURL7);

    SoundMixer.stopAll();

    }


    function mandB2Clicked(event:MouseEvent):void {
    myLoader.load(myURL8);

    SoundMixer.stopAll();

    }

    function verdi09Clicked(event:MouseEvent):void {
    myLoader.load(myURL9);

    SoundMixer.stopAll();

    }
    function ives09Clicked(event:MouseEvent):void {
    myLoader.load(myURL10);

    SoundMixer.stopAll();
    }

    function beethovenClicked(event:MouseEvent):void {
    myLoader.load(myURL11);

    SoundMixer.stopAll();
    }

    function macmillanClicked(event:MouseEvent):void {
    myLoader.load(myURL12);

    SoundMixer.stopAll();


    }


    Last edited by laurabeth; 01-15-2010 at 05:12 PM.

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    If you are publishing for Flash 10, then use the unloadAndStop method of Loader before loading in the next content.

  3. #3
    Member
    Join Date
    Sep 2008
    Posts
    39
    Quote Originally Posted by 5TonsOfFlax View Post
    If you are publishing for Flash 10, then use the unloadAndStop method of Loader before loading in the next content.
    Thanks, I'm publishing for Flash 9/As3... I have CS3

    I tried
    myLoader.unload();
    myLoader.unload();
    box.removeChild(myLoader);
    box.addChild(myLoader);
    before loading new content
    and a bunch of variations of that ... without any success...

  4. #4
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Here's an article describing the situation you're facing, and why unloadAndStop was added.
    http://www.gskinner.com/blog/archive...e_to_unlo.html

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