Highlighted

Can't Load Downloaded Swf Files to AIR App

Community Beginner ,
Sep 30, 2016

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

       }

}

TOPICS
Development

Views

945

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Can't Load Downloaded Swf Files to AIR App

Community Beginner ,
Sep 30, 2016

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

       }

}

TOPICS
Development

Views

946

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 30, 2016 0
Engaged ,
Sep 30, 2016

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?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 30, 2016 0
Community Beginner ,
Sep 30, 2016

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 30, 2016 0
Community Beginner ,
Oct 02, 2016

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 02, 2016 0
Adobe Employee ,
Oct 02, 2016

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 02, 2016 0
Community Beginner ,
Nov 01, 2016

Copy link to clipboard

Copied

Hi,

Do you know this question answer:

Multitouch Not Working

Thank you

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 01, 2016 0