It's so cold this evening, write a JSFL thing to get warm, I am also introduced, this is also translated according to MM's document, interested students, you can take a look ~
JSFL overview
JSFL is a language used in the Flash editing environment, making the F Lash editing environment to perform some operations, such as selecting an object, turning off a already opened document, and more. JSFL includes a series of top-level functions and a top-level object (top-level object) that can be used to reference this object using flash or fl. For example, if you want to close all documents that have been opened in the editing environment, you can use the following statement:
Flash.Closeall ();
Fl.closeall ();
Using Commandsàrun Commands in the Flash menu, you can run the already saved jsfl command.
Flash Object includes several child objects that are basically a reference to the object of the Flash editing environment. For example, Document Object is an array. He is a reference to the document that has been opened, and it is obvious that an array element corresponds to an open document. For example, ComponentsPanel Object references the Flash component panel. But what to say is that in all Flash Object properties, the documents property is the most important.
The Documents property contains an array corresponding to the document that has been opened in Flash. Of course, Documents Object also contains his own properties, which are used to express the elements of most documents. The so-called "performance" is the meaning of guidance and control (I think). So most of a document is composed of the properties of the Documents object and the Child Objects. Here's Child Objects I think it is with attributes, because it is to look at which angle is standing.
If you want to reference the first open document, you can use this statement: Flash.Documents [0]. Flash.Documents [0] refers to the first document opened in the current session. When the first document is turned off, then other later documents will be pushed forward, the original second document replaces the position of the original first document. Of course, a unique name can also be used to obtain document references, and the specific practice is: fl.findocumentDom (), using flash.getDocumentdom () or fl.getDocumentDom () to get a reference to the document currently editing. The objects containing themselves have their own names. The most common is the library, you can use the following statement to get libray reference: fl.getdocumentdom (). Library, use fl.getdocumentdom (). Library.Items
Get list of items in the library, the specific item can use the subscript to specify its reference: fl.getdocumentdom (). Library.Items [0]. That is to say that library object is included in Documents Object.
The JSFL statement will use the statement to the specified object when there is a selected object. For example, the following statement enlarges twice the selection object: fl.getdocumentdom (). Scaleselection (2, 2); So in many cases, first use JSFL to specify an object, then use the JSFL statement to this object, The first object placed on the Stage is twice.
Var element = fl.getdocumentdom (). getTimeline (). Layers [0] .frames [0] .Elements [0]; if (element)
{
Element.width = element.width * 2;
Element.height = element.height * 2;
}
Of course, JSFL also allows for the use of basic process control, what is, what. It should be all, huh, huh, more interesting. Of course, before you really understand the JSFL, you must understand the Flash document structure (DOM Structure), about DOM Structure, see MM's help documentation and related manuals.