F > FPushButton (component)

 

FPushButton (component)

The PushButton component in the Flash authoring environment provides drag-and-drop functionality for adding buttons to Flash documents; it also provides a user interface for setting basic parameters. The methods of the FPushButton component allow you to control buttons at runtime: you can create buttons, control buttons created in authoring, set or override basic parameters, and set additional runtime options. You do not need to use a constructor to access the methods of components.

The PushButton component accepts all standard mouse and keyboard interactions. You can use the FPushButton methods to specify a handler function for push buttons, disable or enable buttons, and resize buttons without distortion at runtime.

Component methods do not perform error checking for type, as do other native ActionScript objects and actions; therefore, it is recommended that you validate parameters before passing them to methods.

The PushButton component is supported by Flash Player 6 and later versions of the Flash Player.

For information on using the PushButton component, setting parameters during authoring, and changing the color and appearance of components, see Customizing component colors and text and Customizing component skins in the Using Components chapter of Using Flash.

 
Method summary for the FPushButton component

Method

Description

FPushButton.getEnabled

Returns true if the button is enabled, false if it is disabled.

FPushButton.getLabel

Returns the button label as a string.

FPushButton.registerSkinElement

Registers a skin element to a property.

FPushButton.setClickHandler

Specifies the function called when the user releases the button.

FPushButton.setEnabled

Determines whether the button is enabled or disabled.

FPushButton.setLabel

Sets the button label at runtime.

FPushButton.setSize

Sets the height and width of the button, in pixels.

FPushButton.setStyleProperty

Sets a single style property for a component.