MACROMEDIA FLASH MX 2004-USING FLASH Use Manual page 448

Hide thumbs Also See for FLASH MX 2004-USING FLASH:
Table of Contents

Advertisement

Number; an integer used to set the control's position in the tab order (available only
tabindex
on Windows).
String; a character to be used for the keyboard shortcut for this control (available
accesskey
only on Windows).
A JavaScript command that executes when the button is clicked.
oncommand
Child tags
None.
Parent tag
<dialog>, <hbox>,
Description
Control tag; creates a button control.
Example
The following example uses the JavaScript API to create a new command that appears in
Commands menu. Create two files, as described in this section, and place them in your
Commands folder in your user-level configuration folder. For more information, see
"Configuration folders installed with Flash" in Getting Started with Flash.
First, create a file named button.jsfl and place it in your Commands folder. Place the following
code into the file and save the file:
// Create an XML to UI dialog box using the XML definition
// in the button.xml file
var buttonDlg = fl.getDocumentDOM().xmlPanel( fl.configURI + "Commands/
button.xml" );
Second, create a file named button.xml and place it in your Commands folder. Place the
following code into the file and save the file:
<?xml version="1.0"?>
<dialog id="button-dialog" title="Button Example" buttons="accept, cancel">
<grid>
<columns>
<column/>
</columns>
<rows>
<row>
<label width="150" value="The following buttons will send text to the
Output Panel"/>
</row>
<row>
<button id="helloBtn"
</row>
<row>
<button id="worldBtn" label="world" oncommand="fl.trace('world')"/>
</row>
</rows>
448
Appendix B: XML to UI
,
<row>
<vbox>
label="Hello" oncommand="fl.trace('Hello')"/>

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash mx 2004 - actionscript

Table of Contents