Content Elements: button

A button specifies a clickable region. A button object may be associated with a specific action, so when the button is clicked, it performs the action.

For example, a button may be associated with the pageNext action in the Viewer; when the user clicks the button, the document flips to the next page. When the end of the document has been reached, the button is automatically disabled. When the user hovers the mouse pointer over the button, a tool tip with the text “Next page” is displayed, providing a clue about the button’s function.

A button object may be skinned using the state attributes upState, overState, downState, and disabledState.

Attributes

name Description
upState Specifies the skin to be used for the button’s up state, i.e. when the mouse pointer is not over the object.
overState Specifies the skin to be used for the button’s over state, i.e. when the mouse pointer is over the object but the mouse button isn’t pressed.
downState Specifies the skin to be used for the button’s down state, i.e. when the mouse pointer is over the object and the mouse button is pressed.
disabledState Specifies the skin to be used for the button’s disabled state, i.e. when the button is in a non-interactive, disabled state.
toolTip Specifies the text to be displayed as the tool tip when the mouse pointer is over the button.
action Specifies the action to be performed when the button is clicked. See Actions

Example

<?xml version="1.0"?>
<viewer xmlns="http://issuu.com/viewer/1.0" backgroundColor="#111111">
 
 <skin source="skins.swf"/>
 
 <button action="fullScreen"
   upState="#FullscreenButton_up" overState="#FullscreenButton_over"
   downState="#FullscreenButton_down" disabledState="#FullscreenButton_disabled"/>
 
 ...
 
</viewer>

In the example above, the button is set to perform the fullScreen action, which takes the Viewer into fullscreen mode. The button uses exported objects from the skins.swf file with the names FullscreenButton_up, FullscreenButton_over, FullscreenButton_down, and FullscreenButton_disabled. Learn about exporting objects from Adobe Flash.

Note: For the button to be visible, the upState attribute must be set. The remaining states are optional: if no disabled state is specified, the up state is used; if no down state is specified, the over state is used; if no over state is specified, the up state is used.

The button element supports all the common attributes, except the background attributes.

 

Contents