2


I have a TextField and I am trying to display embedded images using htmlText:

var test:TextField = new TextField();
test.multiline = true;
test.wordWrap = true;
test.htmlText = 
  "<b>Texttextext:</b> <br> \
  <br> <br> test <img src = '" + "Assets_raftImg" + "'/>sfsf";

In this case the raftImg is in the Assets class. The problem is that the image does not align as it should (it always stays in upper left corner). If I load it using "../blah/img.gif" it works properly.


Any suggestions? Thanks!

nqe
  • 345
  • 3
  • 13

1 Answers1

0

TextField.htmlText reference says :

src: Specifies the URL to an image or SWF file, or the linkage identifier for a movie clip symbol in the library

did you try

[Embed(source="../blah/img.gif", symbol="raftImg")]
var test:TextField = new TextField();
test.multiline = true;
test.wordWrap = true;
test.htmlText = 
  "<b>Texttextext:</b> <br> \
  <br> <br> test <img src = '" + "raftImg" + "'/>sfsf";

?

www0z0k
  • 4,444
  • 3
  • 27
  • 32
  • I'm not that familiar with AS3, but isn't the symbol property used to get a specific asset from another swf? In either case, when compiling I got the error that symbol cannot be used with the gif parser. – nqe Feb 07 '11 at 16:25