views:

40

answers:

1

Hi,

I wanted to insert an image into a RichTextEditor in AIR application. For my surprise I found this code working perfectly if the project was Web application but it doesn't work if I use it into AIR Desktop application. Here's the code

 <mx:RichTextEditor height="100%" width="100%">
    <mx:htmlText>
        <![CDATA[
        <p>This is an image</p><p><img src='file:///C:/flag.png'></p>
        ]]>
    </mx:htmlText>
</mx:RichTextEditor>
<mx:Image source="file:///C:/flag.png" autoLoad="true"/>

The Image are loaded successfully in the "mx:Image" but not in the "mx:RichTextEditor". I have tried also to use "C:\flag.png", C:/flag.png" and "http://www.mysite.com/flag.png"

Could you please help me to figure out why I can insert an image into the RichTextEditor with Web application and not with AIR?

Many thanks,

A: 

I recommend using AIR's HTML control instead to handle this. Apparently TextField doesn't support loading images in AIR. According to the documentation:
For AIR content in the application security sandbox, AIR ignores img tags in HTML content in ActionScript TextField objects. This is to prevent possible phishing attacks.

There is also a bug on this with more info:
http://bugs.adobe.com/jira/browse/SDK-14238

James Ward
Many thanks James for this useful information. I really appreciate your help.
ramyadel