vendredi 24 juin 2016

External SWF not loading when not testing in flashdevelop

What I mean is that when I test it in flashdevelop, the External SWF loads, but when I have the main SWF outside of the project, it won't load. (eg: if I have the main SWF on my desktop, it won't work)

So, I'm trying to make a simple thing where when I click a button, it loads an External SWF.

Here's the function for loading the External SWF:

    public function loadPart(part:String)
    {
        if (loader.numChildren > 0)
            loader.removeChildren(0);
        stage.addChild(loader);
        trace(part)
        loader.load(new URLRequest("../src/"+part+".swf"));
        stage.addChild(medButton)
        stage.addChild(slowButton)
        stage.addChild(fastButton)
    }

part being the name of the SWF

This works fine when I test in flashdevelop, but if I clone the SWF in the bin folder of the project folder to the desktop, it won't work. It also works if I just open the SWF in the bin folder.

Anyone know why this is happening?

Aucun commentaire:

Enregistrer un commentaire