JavaScript for Flash (JSFL)

     

You can customize the Flash environment in a number of ways by using Flash JavaScript (JSFL). The basic procedure is to create a .jsfl file and save it in an appropriate directory.

If you have installed Flash MX 2004, search for files with the extension .jsfl on your hard disk, and you will see that they are used in a number of subdirectories of the "First Run" directory. For example, in a typical Windows installation, if you put a .jsfl file in the C:\Program Files\Macromedia\Flash MX 2004\<language>\First Run\Commands folder (where <language> is the abbreviation for your language, such as en for English), the filename (minus the .jsfl extension) will appear as a command on the Command menu.

On Windows systems, commands that you create with the Save As Command function in the History panel are saved in C:\Documents And Settings\< user name >\Local Settings\ Application Data\Macromedia\Flash MX 2004\<language>\Configuration\Commands , where <user name> is your username and <language> is the abbreviation for your language. By default, the Local Settings folder is hidden.

You can also use .jsfl files to create behaviors, effects, tools, and screen types such as forms and slides.

Macromedia had not yet released JSFL documentation as this book went to press.

JSFLlink.htm on the CD accompanying this book contains a link to JSFL information, including a link to the Macromedia page with the official JSFL documentation.


You can see JSFL code by clicking the options menu in the upper-right corner of the History panel and selecting View, JavaScript in Panel. To edit the JSFL code, select the items you want from the History panel, click the Copy Selected Steps to the Clipboard button at the bottom of the panel (see Figure 14.1), and paste the JSFL code into the Flash Professional script editor (File, New, Flash JavaScript File) or any text editor.

Figure 14.1. Use the Copy Selected Steps to the Clipboard button to cut and paste JSFL code into a text editor or the Flash Professional script editor.
graphics/14fig01.jpg

In the Flash Professional script editor, you can press the + in the upper left to see a menu of JSFL language elements. (See Figure 14.2.)

Figure 14.2. Press the + in the upper left of the Flash Professional script editor to see a menu of JSFL language elements.

graphics/14fig02.jpg




Using Macromedia Studio MX 2004
Special Edition Using Macromedia Studio MX 2004
ISBN: 0789730421
EAN: 2147483647
Year: N/A
Pages: 339

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net