mercredi 14 septembre 2016

How can I unload an SWF that is already loaded to my file on actionscript3

I am trying to make a system that is first unloading any existing (loaded) flash SWF's and then loading one back in (so they won't overlap each other).

I am using a class AS3 file My code looks like

var myLoader:Loader = new Loader();
        removeChild(myLoader);
        myLoader.unload();
        var url:URLRequest = new URLRequest("URL HERE");
        myLoader.load(url);
        addChild(myLoader);

As you can see I'm trying to unload everything first, and then load the new stuff, for some reason it's not working.

Thanks in advance guys!

Aucun commentaire:

Enregistrer un commentaire