Copy link to clipboard
Copied
Hi,
I'm using MyFlashLab "Download Manager" ANE file for download SWF files to directories. (https://github.com/myflashlab/downloadManager-ANE/)
I'm creating application for Android, it will load other downloaded swf files. (Interactive Book Application, load other books when user buy)
Download Manager ANE download my swf files to "/storage/emulated/0/downloads/" directory.
But i cant load swf files to stage.
It create this error after loading: TypeError: Error #1009: Cannot access a property or method of a null object reference.
Any solution please write.
Thank you
MY CODES:
var f:File = File.documentsDirectory;
f = f.resolvePath("downloads/test.swf");
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfComplete);
loader.load(new URLRequest(f.url));
public function swfComplete(e:Event){
try{
addChild(loader);
}catch(err:Error){
trace(err);
}
}
Copy link to clipboard
Copied
A few questions for you. What device are you testing on? What version of Android is it running (4.4, 5.0, 5.1, etc)? Do you have the "WRITE_EXTERNAL_STORAGE" permission set for your app? Lastly, a possibly dumb question, do you know for a fact that the "test.swf" file is located in the "downloads" folder?
Copy link to clipboard
Copied
- Galaxy Tab 3 - SM-T310
- 4.4.2
- I have WRITE_EXTERNAL_STORAGE permission
- I can see test.swf file on downloads folder with File Explorer.
- I trace file url and size. It shows right place and correct size before start loading.
Copy link to clipboard
Copied
If loaded swf has no Main class, it loaded perfect and works. (I tested with empty only has colorful circles swf)
But if swf has Main class, always gives errors.
Copy link to clipboard
Copied
Hi Efe,
Please refer to below blogs on loading another external swf file as assets:
ApplicationDomain - Adobe ActionScript® 3 (AS3 ) API Reference
How to load external SWF files for Adobe Flash Player
Kindly let us know if it helps you.
Thanks,
Adobe AIR Team
Copy link to clipboard
Copied