# Img tag not working in textfield

**URL:** <https://forum.kirupa.com/t/img-tag-not-working-in-textfield/316761>\
**Category:** Uncategorized\
**Created:** [December 1, 2010, 10:39pm UTC](https://forum.kirupa.com/t/img-tag-not-working-in-textfield/316761 "2010-12-01T22:39:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jlupa](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@Jlupa](https://forum.kirupa.com/u/Jlupa)\
**Post date:** [December 1, 2010, 10:39pm UTC](https://forum.kirupa.com/t/img-tag-not-working-in-textfield/316761/1 "2010-12-01T22:39:04Z")

</div>

Hi,

I am using in Flash builder and I’m trying to embed an image in a TextField, but the image is not showing up. I have tried the following code:

**[SIZE=2][COLOR=#0033ff][SIZE=2][COLOR=#0033ff]**[/COLOR][/SIZE][/COLOR][/SIZE]**[SIZE=2][COLOR=#6699cc][SIZE=2][COLOR=#6699cc]var**[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] myTextField:TextField = [/SIZE]**[SIZE=2][COLOR=#0033ff][SIZE=2][COLOR=#0033ff]new**[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] TextField();[/SIZE]\*[SIZE=2][COLOR=#009900][SIZE=2][COLOR=#009900]  
_[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]myTextField.type = TextFieldType.INPUT;  
[SIZE=2]myTextField.htmlText = [/SIZE]**[SIZE=2][COLOR=#990000][SIZE=2][COLOR=#990000]“A picture of a lake: \<img id=‘mImage’ width=‘180’ height=‘120’ align=‘center’ vspace=‘0’ hspace=‘0’ src=‘half-shoe.JPG’\>”**[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];  
[/SIZE][SIZE=2]addChild(myTextField);  
[/SIZE]  
I’ve also tried:  
 **[SIZE=2][COLOR=#6699cc][SIZE=2][COLOR=#6699cc]var**[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] myTextField:TextField = [/SIZE]**[SIZE=2][COLOR=#0033ff][SIZE=2][COLOR=#0033ff]new**[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] TextField();[/SIZE]_[SIZE=2][COLOR=#009900][SIZE=2][COLOR=#009900]  
\*[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]myTextField.type = TextFieldType.INPUT;  
[SIZE=2][SIZE=2]myTextField.htmlText = [/SIZE]**[SIZE=2][COLOR=#990000][SIZE=2][COLOR=#990000]“A picture of a lake: \<img id=‘mImage’ width=‘180’ height=‘120’ align=‘center’ vspace=‘0’ hspace=‘0’ src=‘[http://www.java2s.com/asb/image2.jpg](http://www.java2s.com/asb/image2.jpg)’\>”**[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];  
[/SIZE][/SIZE][SIZE=2]addChild(myTextField);[/SIZE]  
[SIZE=2][/SIZE]  
[SIZE=2]In either case the text “**[COLOR=#990000]A picture of a lake[/COLOR]**” shows up but there is no image. I’m not sure what the problem is. Any help would be appreciated.[/SIZE][/SIZE]  
[/SIZE]
