RichTextEditor Adobe AIR 中的 img 标签
我想将图像插入到 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议使用 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