RichTextEditor Adob​​e AIR 中的 img 标签

发布于 2024-09-11 07:10:00 字数 741 浏览 1 评论 0原文

我想将图像插入到 AIR 应用程序中的 RichTextEditor 中。令我惊讶的是,如果项目是 Web 应用程序,我发现这段代码可以完美工作,但如果我将它用于 AIR 桌面应用程序,则它不起作用。这是代码

 <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"/>

图像已成功加载到“mx:Image”中,但未加载到“mx:RichTextEditor”中。我也尝试过使用“C:\flag.png”、C:/flag.png“和” http://www.mysite.com/flag.png"

您能帮我弄清楚为什么我可以使用 Web 应用程序而不是使用 AIR 将图像插入到 RichTextEditor 中吗?

非常感谢,

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,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

纸伞微斜 2024-09-18 07:10:00

我建议使用 AIR 的 HTML 控件来处理此问题。显然 TextField 不支持在 AIR 中加载图像。根据文档
对于应用程序安全沙箱中的 AIR 内容,AIR 会忽略 ActionScript TextField 对象中 HTML 内容中的 img 标签。这是为了防止可能的网络钓鱼攻击。

这方面还存在一个错误,并提供更多信息:
http://bugs.adobe.com/jira/browse/SDK-14238

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文