I ran into the same problem that wanted to get the search icon in TextInput sparks. It was very simple to copy the existing spark skin and add an icon to it. Here's how:
- , .
- FlashBuilder, "" > " MXML"
- " " , .
- " " TextInput, , select spark.skins.spark.TextInputSkin.
- (, TextInputSkinWithPromptIcon) ""
- , .
<!-- text -->. <!-- search icon -->, (: ):
<s:Image id="iconDisplay" source="@Embed('path/to/image/file/MY_SEARCH_IMAGE.png')"
mouseEnabled="false" mouseChildren="false"
visible.normal="false" visible.normalWithPrompt="true"/>
, , ( : , iconDisplay , ):
/* Define the skin elements that should not be colorized. */
static private const exclusions:Array = ["background", "textDisplay", "promptDisplay", "iconDisplay", "border"];
/* exclusions before Flex 4.5 for backwards-compatibility purposes */
static private const exclusions_4_0:Array = ["background", "textDisplay", "promptDisplay", "iconDisplay",];
, TextInput, , : <s:TextInput ... skinClass="path.to.skins.TextInputSkinWithPromptIcon" prompt=" "/>
- , 9 TextInput , . , , . , , - ( ).
- ! ...