无法访问 htmlText 中的嵌入图像 [英] Unable to access embedded images in htmlText
本文介绍了无法访问 htmlText 中的嵌入图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可以使用 htmlText
属性将图像包含在 TextArea
控件中:
ta.htmlText = '';
我如何引用嵌入的图像?
示例:
<mx:脚本><![CDATA[[嵌入(source='../assets/img.gif')]公共变量 img:Class;]]></mx:脚本><![CDATA[<img src="???"/>]]></mx:htmlText></mx:TextArea>
UPD:
在本地机器上工作,但在服务器环境中它抛出:
<前>错误 #2044:未处理的 IOErrorEvent:.文本=错误 #2035:未找到 URL.我该如何解决这个问题?
解决方案
尝试:
<![CDATA[<p><img src='../assets/butterfly.gif'宽度='30' 高度='30'对齐='左'hspace='10' vspace='10'></p>]]></mx:htmlText>
请参阅文档.>
Images can be included in TextArea
controls using the htmlText
property:
ta.htmlText = '<img src="http://..."/>';
How can I reference embedded images?
An example:
<mx:TextArea xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
[Embed(source='../assets/img.gif')]
public var img:Class;
]]>
</mx:Script>
<mx:htmlText>
<![CDATA[
<img src="???" />
]]>
</mx:htmlText>
</mx:TextArea>
UPD:
<img src='../assets/img.gif />
works on local machine, but in server environment it throws:
Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.
How can I fix this?
解决方案
Try:
<mx:htmlText>
<![CDATA[
<p>
<img src='../assets/butterfly.gif'
width='30' height='30'
align='left'
hspace='10' vspace='10'>
</p>
]]>
</mx:htmlText>
See documentation.
这篇关于无法访问 htmlText 中的嵌入图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文