You maybe want to add image or icon like magnifiying icon in textInput of your flex, Here i have some method how you can do that :
Create AS Component
package nebula.utils
{
import mx.controls.Image;
import mx.controls.TextInput;
public class SearchTextInput extends TextInput
{
public function SearchTextInput()
{
}
override protected function createChildren():void
{
super.createChildren();
var searchImg:Image = new Image();
searchImg.source = Images.search_icon;
searchImg.width=12;
searchImg.height=12;
searchImg.x = 2;
searchImg.y = 3;
setStyle("paddingLeft",searchImg.width+2);
addChild(searchImg);
}
}
}
in mxml component you put this:
<utils:SearchTextInput text="enter professional name ..." id="searchPro" click="{searchPro.text = ''}" width="200"/>
Another Alternative (sometime not work)
<mx:HBox>
<mx:TextInput id="myTextInput" />
<mx:Images source="{your_image_url}" paddingLeft="6" />
</mx:HBox>
No Response to "How To add image into any Textinput"
Post a Comment