无法访问htmlText中的嵌入式图像 [英] Unable to access embedded images in htmlText
本文介绍了无法访问htmlText中的嵌入式图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
图片可以包含在 TextArea
控件中,使用 htmlText
属性:
ta.htmlText ='< img src =http:// .../>';
如何引用嵌入图片?
例如:
< 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 />
可以在本地机器上运行,但是在服务器环境中会抛出:
错误#2044:未处理的IOErrorEvent :.文本=错误#2035:URL未找到。
我该如何解决这个问题?
解决方案
试试:
< mx:htmlText>
<![CDATA [
< p>
< img src ='.. / assets / butterfly.gif'
width = '30'height = '30'
align ='left'
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屋!
查看全文