Skip to main content
efecomert
Participating Frequently
September 30, 2016
Question

Can't Load Downloaded Swf Files to AIR App

  • September 30, 2016
  • 3 replies
  • 1859 views

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);

       }

}

This topic has been closed for replies.

3 replies

efecomert
efecomertAuthor
Participating Frequently
November 1, 2016

Hi,

Do you know this question answer:

Multitouch Not Working

Thank you

efecomert
efecomertAuthor
Participating Frequently
October 2, 2016

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.

deesharm
Adobe Employee
Adobe Employee
October 3, 2016

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

September 30, 2016

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?

efecomert
efecomertAuthor
Participating Frequently
September 30, 2016

- 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.