Highlighted

Loader.loadBytes for swf with code (ABC) in iOS

Community Beginner ,
Jun 16, 2014

Copy link to clipboard

Copied


I'm at a loss.

I read blog and read help and I understand it's possible: loadBytes() must work.

But when I try do it I catch error (uncompiled ActionScript warning).

And then I found Release Notes with prohibited of loadBytes(): Methods unload() and loadBytes()of the loader class will not work on iOS

Where is true? Why some developres talk it's possible? How?

Thanx!

AFAIK, that Adobe blog is the correct and latest information with regards to iOS and assets with code in them.

So the only SWFs which you can load at runtime are those which you've packaged with ADT during packaging time.  This is because their ABC are compiled for iOS at that time, and their code is stored in the IPA.

So you'd load those SWFs with an app-local URL, like app://assets/level1.swf

You could load their bytes with the File class (./assets/level1.swf), and then I assume loadBytes would work.

It seems I've read that you can unzip the IPA and store those SWFs on a remote server, then load them at runtime and it works.  But the key is that you have to load the SWFs which were packaged with the app, as they've been cross-compiled for iOS and had their ABC stripped out and linked into your app.

All this is to be compliant with Apple -- all code must have been linked at packaging time.

TOPICS
Air beta

Views

527

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

Loader.loadBytes for swf with code (ABC) in iOS

Community Beginner ,
Jun 16, 2014

Copy link to clipboard

Copied


I'm at a loss.

I read blog and read help and I understand it's possible: loadBytes() must work.

But when I try do it I catch error (uncompiled ActionScript warning).

And then I found Release Notes with prohibited of loadBytes(): Methods unload() and loadBytes()of the loader class will not work on iOS

Where is true? Why some developres talk it's possible? How?

Thanx!

AFAIK, that Adobe blog is the correct and latest information with regards to iOS and assets with code in them.

So the only SWFs which you can load at runtime are those which you've packaged with ADT during packaging time.  This is because their ABC are compiled for iOS at that time, and their code is stored in the IPA.

So you'd load those SWFs with an app-local URL, like app://assets/level1.swf

You could load their bytes with the File class (./assets/level1.swf), and then I assume loadBytes would work.

It seems I've read that you can unzip the IPA and store those SWFs on a remote server, then load them at runtime and it works.  But the key is that you have to load the SWFs which were packaged with the app, as they've been cross-compiled for iOS and had their ABC stripped out and linked into your app.

All this is to be compliant with Apple -- all code must have been linked at packaging time.

TOPICS
Air beta

Views

528

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
Jun 16, 2014 0
Participant ,
Jun 16, 2014

Copy link to clipboard

Copied

AFAIK, that Adobe blog is the correct and latest information with regards to iOS and assets with code in them.

So the only SWFs which you can load at runtime are those which you've packaged with ADT during packaging time.  This is because their ABC are compiled for iOS at that time, and their code is stored in the IPA.

So you'd load those SWFs with an app-local URL, like app://assets/level1.swf

You could load their bytes with the File class (./assets/level1.swf), and then I assume loadBytes would work.

It seems I've read that you can unzip the IPA and store those SWFs on a remote server, then load them at runtime and it works.  But the key is that you have to load the SWFs which were packaged with the app, as they've been cross-compiled for iOS and had their ABC stripped out and linked into your app.

All this is to be compliant with Apple -- all code must have been linked at packaging time.

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...
Jun 16, 2014 0
Community Beginner ,
Jun 18, 2014

Copy link to clipboard

Copied

I checked it out. Really works.

It does not work with dynamic swf files. Ie files that assemble from ByteArray AFTER AOT compilation (at runtime).

If the file is passed through the AOT compilation, then it can be loaded by loadBytes. Probably it can be change some bytes except bytes block of ABC (block of code).

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...
Jun 18, 2014 0