• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

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

Community Beginner ,
Jun 16, 2014 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!

TOPICS
Air beta

Views

644

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
community guidelines

correct answers 1 Correct answer

Participant , Jun 16, 2014 Jun 16, 2014

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 w

...

Votes

Translate

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

Votes

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
community guidelines
Community Beginner ,
Jun 18, 2014 Jun 18, 2014

Copy link to clipboard

Copied

LATEST

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

Votes

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
community guidelines