开发者

Using Images in flex/flash html controls

Using the flex text area I am trying to put an image inside a list. Whatever I do, the image is pushed to a new line. If anyone has dealt with this before would more than appreciate a pointer as to whether it can be done. The html is below. I wan开发者_如何学JAVAt to show text and the image on the same line in list item 2. I have taken some of the formatting out for readability.

 <TEXTFORMAT ><LI><FONT  SIZE="18">1 some text</FONT></LI></TEXTFORMAT>
 <TEXTFORMAT><FONT SIZE="18">2 some <FONT COLOR="#0000FF">
 <A HREF="event:http://bbc.co.uk" TARGET="_blank">
 <img id='testImage' src='embed.AcceptIcon' width='16' height='16'/>   
 </A></FONT></FONT></LI></TEXTFORMAT>
  <TEXTFORMAT ><LI><FONT SIZE="18">3 some text after the image.</FONT></LI></TEXTFORMAT>


From the Adobe LiveDocs :

In general, an image embedded in a text field appears on the line following the tag. However, when the tag is the first character in the text field, the image appears on the first line of the text field.


This is a limitation of the older text engine currently used by Flash 9/10 and below. Anything which uses flash.text.TextField (such as Flex 2 & 3) will have this problem.

However, Flex 4 (and Flash 10) now have rich text support, which provides some really interesting features. Inline images are one of them. Because the engine (flash.text.engine) is really powerful, using it can be rather complex. However, Flex 4's text UI now wraps the text engine, so it should be provided for you for free.

Example:

http://www.bytearray.org/?p=499

Also, search for "text ligature" in theflashblog.org site

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜