Display images in an AIR application

I want to display an image located in the application directory of my AIR application. This image should be displayed in the html text area where the html text comes from the local sqlite embedded database.

When I put the following code:

imageTest.htmlText = '<img src="app-storage:/demo.jpg" border="0" />';

nothing is displayed.

But when instead of the path to the application store, I put the absolute URL of the image on the Internet, as shown below:

imageTest.htmlText = '<img src="http://www.example.com/demo.jpg" border="0" />';

The image is displayed correctly.

In addition, I checked that the application storage method is able to find the image, but it just does not appear in the htmlText container. For example, the following code displays an image:

imageTest.location = 'app-storage:/demo.jpg';

Any suggestions what should I do to display an image? I am using Adobe Flex Builder 3 as an IDE.

Thanks
Vinayak

+5
4

?

imageTest.htmlText = '<img src="'+ File.applicationStorageDirectory.nativePath +'/demo.jpg" border="0" />';
+1

! , SDK Flex Builder Eclipse IDE, , Adobe FlexBuilder:

imageTest.htmlText = '<img src="app-storage:/folder/demo.jpg" />';

, .

0

All Articles