|
-
Senior Member
[AS3] How do i load pictures in text field?
i tried:
dyntxt.htmText="Test <img src='image/pic/laugh.gif' id='laugh1'> !!";
But nothing is being embedded, except "Test !!"......any ideas?
-
Senior Member
dyntxt.htmlText
I am surprised you did not get any error.
- The right of the People to create Flash movies shall not be infringed. -
-
change htm to html and it works fine:
PHP Code:
dyntxt.htmlText="Test <img src='http://www.make-some-noise.info/badges/88x31.gif' id='laugh1'> !!";
-
Senior Member
well it works now, but still, the image is not placed correctly within the text, and over that, i cannot attach more than one of the same image!
Code:
function doReplace(msg):String
{
var _search:Array = [":b:","":_b:",":)"];
var _replace:Array = ["<b>","</b>","<img src='images/smiley/laugh.gif' id='::laugh"+i+"::'>"];
for(var i:int=0;i<_search.length;i++)
{
msg = msg.split(_search[i]).join(_replace[i]);
}
return msg;
}
i am using the split.join instead of replace, because of my habit from as2, but can you guys give me any more suggestions on how to put multiple instances of same smiley and how to position them correctly?
-
You're trying to load a .gif file into TextField? TextField does not support animated gif files, if that's what you're hoping for. instead, try to use TextArea >> http://doitflash.com/
MyFlashLab Team
Hadi
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|