A clickable button component that may display content such as text and an image.

Add button content

Display text in a button:

<js:TextButton text="Click Me"/>

Display both text and an image in a button:

<js:ImageAndTextButton text="Click Me" image="path/to/image.png"/>

Listen to events

Listen for a button click event:

<js:TextButton text="Click Me" click="onClick()"/>
<fx:Script>
<![CDATA[
private function onClick():void
{
trace("button clicked!");
}
]]>
</fx:Script>

Change button appearance

Set font styles on a single button:

<js:TextButton text="Click Me">
    <js:style>
        <js:SimpleCSSStyles fontFamily="serif" fontSize="20"
fontWeight="bold" fontStyle="italic" color="#ff0000"/>
    </js:style>
</js:TextButton>

 

 

  • No labels