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

import SWFs into Flex iOS app?

Contributor ,
Sep 10, 2011 Sep 10, 2011

Copy link to clipboard

Copied

My mobile iOS app is supposed to load SWF assets from an external server, and now after nearly 2 weeks of development, I just discovered that it does not work with the "standard packaging" method.  This is because, after the ActionScript and MXML is converted thru LLVM for iOS, SWFs are no longer supported!

Is there any chance at a work around?  In the case of my app, it is only importing static SWFs (not animations). Could something like the ByteArray and/or BitMapData classes be used to convert the SWFs to a static bitmap image?

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/utils/ByteArray.html

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/BitmapData.html

If ByteArray is implemented to immediately convert imported SWFs within the source FlashBuilder project, then when the app is packaged into native iOS, will it retain that functionality to convert the SWF to bitmap data?


Views

2.9K

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
Contributor ,
Sep 10, 2011 Sep 10, 2011

Copy link to clipboard

Copied

and/or maybe use the JPGEncoder?:


http://henryjones.us/articles/using-the-as3-jpeg-encoder

import com.adobe.images.JPGEncoder;
var jpgEncoder:JPGEncoder = new JPGEncoder(85);
var jpgStream:ByteArray = jpgEncoder.encode(bmpData);

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
Contributor ,
Sep 10, 2011 Sep 10, 2011

Copy link to clipboard

Copied

You can load SWF's, but any ActionScript in that SWF will not execute. This is a limitation imposed by Apple: they forbid execution of interpreted, JITted or downloaded code.To split your project into modules, use the SWC model:

http://www.flashrealtime.com/compiling-big-air-swf-to-ios/

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
Contributor ,
Sep 13, 2011 Sep 13, 2011

Copy link to clipboard

Copied

Yes, SWC is a good solution in most cases, however, in our project, all of the SWF assets are being loaded on an individual basis from an remote server.  So 1) as far as I know, we cannot import an SWC file across a network at run-time, right? and 2), we have hundreds of individual assets files, and do not need or want to download an entire package of all of assets, just a few at a time.

I think the only solution for this project will be to convert our SWF assets into something like PNG instead.  I'm just trying to be certain that this is the only option. 

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
Contributor ,
Sep 15, 2011 Sep 15, 2011

Copy link to clipboard

Copied

You can load SWF's. They'll just load as dumb libraries with no actionscript. You can then access the individual assets within the .SWF. Another option would be to group your PNG's into (non-compressed) .ZIP files and load them with FZip.

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
New Here ,
Oct 12, 2011 Oct 12, 2011

Copy link to clipboard

Copied

I'm trying to load local Flash Pro CS4 SWFs into my Flash Builder 4.5 iOS application but I'm getting errors I think are related to this. The app runs fine in the iPad emulator in Flash Builder. When I go to the device I get:

[SWF] data/coreAudio.swf - 1,285,650 bytes after decompression

VerifyError: Error #1107: The ABC data is corrupt, attempt to read out of bounds.

The SWFs are included in the package. So it looks like there ARE problems with SWF loading in Flash Builder iOS apps?

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
Explorer ,
Dec 09, 2011 Dec 09, 2011

Copy link to clipboard

Copied

LATEST

Yeah, I've posted about on this issue as well.  I think we're stuck with flattening swf's into png's.  I've seen no other options.

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