2
votes

I'm doing an isogame with as3isolib, using FlashDevelop under win7. The game needs to load some external SWF coded with AS2. When I debug the application, it manages to load the SWF when the player reaches a given position. The program instantiates a button (from that SWF) which closes (removeChild) both the button and the loaded SWF. But when I copy/paste the bin folder, to other location (for display purposes to the other team mates), the SWF it's not loaded (but the button contained in that SWF is loaded!). Folder structure as follows:

  • isoGame/bin;
  • isoGame/libs/...all libs;
  • isoGame/src/... the main actionscript;
  • isoGame/src/game... all custom as
  • isoGame/scr/game/assets

There's a file called Assets.as, that contains the path to all resources. For instance, "OVA.swf". That file is copied inside /assets and /bin. But again, when I want to change the folder location, the SWF is not loaded.

The function loading the SWF is:

private function onUpdate( e:Event ):void
{
    if (_avatar.x == 4 * _level.CELLSIZE && _avatar.y == 4 * _level.CELLSIZE) 
    {

        //_swfFile = new URLRequest(Assets.OVA1_PATH);

        _swfLoader.load(new URLRequest(Assets.OVA1_PATH));
        _swfLoader.x = (Constants.PLAYER_WIDTH - 550) / 2;
        _swfLoader.y = (Constants.PLAYER_HEIGHT - 400) / 2;

        close_btn = new Assets.CLOSE_BTN_CLASS();
        close_btn.addEventListener( MouseEvent.MOUSE_UP, onCloseOVA );
        close_btn.x = 550 + _swfLoader.x;
        close_btn.y = _swfLoader.y;

        //adding the objects
        addChild(_swfLoader);
        addChild(close_btn);
    }
}

Thanks!

1

1 Answers

0
votes

SOLVED!

Just changed the security of the SWF.

Go to File->Publish settings-> Local playback security: Access network only

This way, the SWF files are nicely loaded (with the AS2.0 code written on it).

By the way, I don't know if this will be the opposite if those files are on a server for public access. When I do the testings, I'll write them here.