Jsfl refers to flash JavaScript, which is a Javascript script file and an important tool used to expand flash IDE. After learning it and using it skillfully, you will be surprised to find that, wow, flash can be done so efficiently! Let's take a look at how to use jsfl:
I wonder if you have used the "history panel" in Flash IDE "? If you have never used it, press Ctrl + F10 to check it out, because the content of this article will start from it.
In flash IDE (I use Flash CS3 professional) press the r key (the shortcut key of the rectangle drawing tool), drag the mouse on the stage to draw a rectangle. Observe the "history panel" and you will find an action named "rectangle" added to the Panel. Select the "rectangle" action. The disk icon button in the lower-right corner of the "history panel" will be activated. Click this button to save the command as "drawrect ". Next, delete the rectangle that was just drawn on the stage and select the "command" menu in the Flash menu bar. You will find that there is an option named "drawrect" in the pop-up menu, click the "drawrect" option to see the effect.
If you have never been in touch with jsfl before, you will doubt: How did the "drawrect" option go to the "command" menu? After clicking it, a rectangle is drawn immediately on the stage. What is the principle? Next we will explore the mysteries.
Open c: \ Documents and Settings \ Brant \ Local Settings \ Application Data \ Adobe \ Flash CS3 \ zh_cn \ Configuration \ commands (note that the local settings folder is hidden by default, you need to hide the file to see it ). In this folder, you will find a file named "drawrect. jsfl file, open it with a text editing tool (I use flashdevelop or utrledit to open it), look at the content, it does not matter, first, let's take a look at the code and draw a rectangle on the stage. This is jsfl. Next, you should press F1 in Flash IDE and enter "jsfl" to view the help documentation. First, let's take a look at the description of jsfl's role, and then focus on the content in "extended flas-> Object". After reading the content, enter "library" (or document, item, outputpanel, and other words) in the help, and take a closer look at the things in "extended flas-> Object. Don't be surprised "There are so many contents !". Well, there are indeed a lot of content in this part of knowledge point, all of which are flash IDE's JavaScript APIs. These APIs can be used to implement all the actions in the Flash IDE environment. To fully understand it, you need to learn JavaScript, but you don't have to worry about it. It's very simple, because JavaScript and as are basically the same, and the keywords, syntax, and structure all follow the ECMA script standard in a unified manner, according to the as habits, you can write JavaScript code, and the learning curve will be smoother. Now, let's take a look at the content. I will not wait for you to finish it here. I will write two simple examples to illustrate how to use jsfl:
[Note] the following directory c: \ Documents and Settings \ Brant \ Local Settings \ Application Data \ Adobe \ Flash CS3 \ zh_cn \ Configuration \ commands is abbreviated as commands.
Example 1: bitmapbatrename (batch name images in the library ):
Step 1: Create a text document, paste the following code into the document, save it to the commands directory, and save the name as "bitmapbatrename. jsfl ". Note that the extension is jsfl rather than TXT.
VaR Doc = fL. getdocumentdom ();
VaR uxi = Doc. xmlpanel (FL. configuri + "commands/rename. xml ");
If (uxi. Dismiss = "accept ")
{
VaR items = Doc. Library. getselecteditems ();
For (VAR I = 0; I <items. length; I ++)
{
Items [I]. Name = uxi. prefixname + I;
}
}
Step 2: Create a text document, paste the following code into the document, save it to the commands directory, and save the name as "RENAME. xml ". Note that the extension is XML.
<? XML version = "1.0" encoding = "UTF-8"?>
<Dialog buttons = "Accept, cancel" Title = "bat rename tool">
<Label value = "Enter the name prefix"/>
<Textbox id = "prefixname"/>
</Dialog>
Step 3: Create a new flash document, import a set of images to the library, select one, several, or all of the images in the library, and select "command-> bitmapbatrename ", in the pop-up dialog box, enter a name and click OK to see if the image name in the library has changed. OK. Example 1 ends.
Http://hi.baidu.com/jmtbai/blog/item/533852d81b00d1e438012f70.html