![]() ![]() ![]() | |
![]() | |
![]() | |
![]() |
Flash Player 6.0.79.
Flash MX 2004.
buttonInstance
.icon
Property; A string that specifies the linkage identifier of a symbol in the library to be used as an icon for a button instance. The icon can be a movie clip symbol or a graphic symbol with an upper left registration point. You must resize the button if the icon is too large to fit; neither the button nor the icon will resize automatically. If an icon is larger than a button, the icon will extend over the borders of the button.
To create a custom icon, create a movie clip or graphic symbol. Select the symbol on the Stage in edit symbols mode and enter 0 in both the X and Y boxes in the Property inspector. In the Library panel, select the movie clip and select Linkage from the Options menu. Select Export for ActionScript, and enter an identifier in the Identifier text box.
The default value is an empty string (""
), which indicates that there is no icon.
Use the labelPlacement
property to set the position of the icon in relation to the button.
The following code assigns the movie clip from the Library panel with the linkage identifier happiness
to the Button instance as an icon:
myButton.icon = "happiness"
![]() | |
![]() | |
![]() | |
![]() ![]() ![]() |