Question

I'm building an AS3 project in FlashDevelop where I use a URLRequest to load external .pngs from an assets folder in the bin/ directory. It works great when run from FlashDevelop or when run from the bin/ folder (which makes sense since as I understand FD sets bin/ to be a trusted directory) but doesn't work when the bin/ folder is moved or renamed.

I've seen people say that if the compiler option Use Network Services is set to false it should be able to load from a local file system but this isn't working for me and I haven't heard of anyone having success with it.

Am I missing something? If this is impossible is there another way to load .pngs from a local file system?

EDIT: The code I'm using to load the .pngs is

var url:URLRequest = new URLRequest("assets/sprite1.png");
var l:Loader = new Loader();
l.load(url);
l.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadCallBack);

Later in the code I have

private function onLoadCallBack(e:Event):void
{
    var bmp:Bitmap = e.target.content;
    //do things with bmp
    addChild(bmp);
}
Was it helpful?

Solution

I managed to get it to work. For whatever reason just setting Use Network Services to false in the compile options wasn't doing anything so I added -use-network=false to my compiler flags and my assets now load correctly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top