MACROMEDIA FLASH MX 2004-USING FLASH Use Manual page 451

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

Advertisement

Parent tag
<dialog>, <hbox>,
Description
Control tag; creates a file chooser control (this is not part of the XUL standard). This control
provides users with access to the operating system's file selection dialog box.
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 choosefile.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 choosefile.xml file
var chooseFileDlg = fl.getDocumentDOM().xmlPanel( fl.configURI + "Commands/
choosefile.xml" );
if (chooseFileDlg.dismiss == "accept") {
var path = chooseFileDlg.choosefileControl;
fl.trace(path);
}
Second, create a file named choosefile.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="choosefile-dialog" title="Choose File Example" buttons="accept,
cancel">
<vbox>
<label value="Please select a file: "/>
<choosefile id="choosefileControl" type="open" pathtype="relative"/>
</vbox>
</dialog>
The
command now appears on the Commands menu. If you have a Flash document
choosefile
open, you can select the
defined by choosefile.xml appears, as shown in the following figure:
,
<row>
<vbox>
command from the Commands menu and the dialog box
choosefile
<choosefile>
451

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash mx 2004 - actionscript

Table of Contents