dimanche 28 février 2016

load and remove swf

i have a problem in my app i set many buttons in the main swf each button load different swf the problem happens when i load a swf that contain sound even i remove it to load another one the sound still play in the background i can't find a way to remove the swf with its sound

if(e.target.name=="gamepage")
    {
        removeChildAt(0)
        mycontent.addChild(myLoader);
        myLoader.load(new URLRequest("game.swf"));
        nextpage.visible=false
        prevpage.visible=false;
        nextbtn.visible=false;
        prevbtn.visible=false;
        Tweener.addTween(mycontent, {rotation:360, time:5});
        i=0;
        }

i also used the unloadandstop but it didn't work

Loader(mycontent.getChildByName("myloader")).unloadAndStop();
        mycontent.removeChild(mycontent.getChildByName("myloader"));

Aucun commentaire:

Enregistrer un commentaire