Skip to main content
September 16, 2011
Answered

Loading dynamic images for Ipa version - issue solved?

  • September 16, 2011
  • 1 reply
  • 1696 views

Hello all,

I am facing the same issue reported in the thread below about loading images dinamically in iOS apps:

http://forums.adobe.com/thread/868630

In debug mode (using the Fast Method), images can be loaded dinamically in the iPad application. But when the final app IPA version is generated, images cannot be loaded dinamically. Just embedded images are shown.

Can anyone inform if this issue has been solved or if there is any workaround for it?

Thanks

Inacio.

This topic has been closed for replies.
Correct answer

Hello Ashutosh,

Bug 2978380 is not visible for us. Can we possibily know its status?

Thanks

Inacio.


Hi

Does the following Flex code cover your use case? I have mailed a .zip to vasqueznet@gmail.com that has a flex project loads a png like below.

<?xml version="1.0" encoding="utf-8"?>

<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"

xmlns:s="library://ns.adobe.com/flex/spark" title="HomeView">

<fx:Script>

<![CDATA[

[Bindable]

private var url:String ="http://www.messersmith.name/wordpress/wp-content/png-national-emblem.png"

]]>

</fx:Script>

<s:Image id="ImgLogo" horizontalCenter="0" verticalCenter="0" source="{url}"/>

</s:View>

Are you by any chance using another swf file that supplies the url. No external swf can be loaded in the release version. So if your code is arranged in a way that the url for the png is part of some other swf file then you need to refactor your code to have a single swf file.

1 reply

Participating Frequently
September 16, 2011

You won't be able to load any swf with actionscript code in "standard" mode. Could you specify how you are loading the image?

Participant
September 16, 2011

Hi sanika,

Replying your question to Inacio (we work together):

Would am I able to load a png image with actionscript code in "standard" mode?

I've tried to load it with this code:

...

var loader:URLLoader = new URLLoader();

loader.addEventListener(Event.COMPLETE, downloadComplete);

loader.addEventListener(IOErrorEvent.IO_ERROR, downloadFault);

var urlReq:URLRequest = new URLRequest("http://image-url.png");

loader.dataFormat = URLLoaderDataFormat.BINARY;

loader.load(urlReq);

...

protected function downloadComplete(event:Event):void{

     var sprite:Image = new Image();

     addElement(sprite);

}

I've noted that the image is perfectly downloaded, but the picture isn't shown.

Can you help me?

Best regards!

Adobe Employee
September 19, 2011

If you're using Flex, you could set the Image's source to "http://image-url.png".

Else, in the code snippet above, it's not clear how the loaded image is being added to the display list. Could you please provide the entire code?