Reviews & Opinions
Independent and trusted. Read before buy Macromedia Flash MX 2004-flash Javascript Dictionary!

Macromedia Flash MX 2004-flash Javascript Dictionary


Bookmark
Macromedia Flash MX 2004-flash Javascript Dictionary

Bookmark and Share

 

Macromedia Flash MX 2004-flash Javascript DictionaryAbout Macromedia Flash MX 2004-flash Javascript Dictionary
Here you can find all about Macromedia Flash MX 2004-flash Javascript Dictionary like manual and other informations. For example: review.

Macromedia Flash MX 2004-flash Javascript Dictionary manual (user guide) is ready to download for free.

On the bottom of page users can write a review. If you own a Macromedia Flash MX 2004-flash Javascript Dictionary please write about it to help other people.
[ Report abuse or wrong photo | Share your Macromedia Flash MX 2004-flash Javascript Dictionary photo ]

 

 

Manual

Preview of first few manual pages (at low quality). Check before download. Click to enlarge.
Manual - 1 page  Manual - 2 page  Manual - 3 page 

Download (English)
Macromedia Flash MX 2004-flash Javascript Dictionary, size: 3.0 MB

 

Macromedia Flash MX 2004-flash Javascript Dictionary

 

 

User reviews and opinions

<== Click here to post a new opinion, comment, review, etc.

Comments to date: 1. Page 1 of 1. Average Rating:
sanjeeviathreya 11:47am on Thursday, April 8th, 2010 
SAY A BIG NO TO MX 2004 If you are a designer or someone trying learn flash for the first time DO NOT BUY Flash MX 2004 or Flash MX 2004 Pro.

Comments posted on www.ps2netdrivers.net are solely the views and opinions of the people posting them and do not necessarily reflect the views or opinions of us.

 

Documents

doc0

Overview of the Macromedia Flash JavaScript API
The ActionScript language lets you write scripts to perform actions in the Macromedia Flash Player environment (that is, while a SWF file is playing). The Flash JavaScript API (JSAPI) lets you write scripts to perform several actions in the Flash authoring environment (that is, while a user has the Flash program open). You can write scripts that act like commands and scripts that add tools to the Tools panel. These scripts can be used to help automate the authoring process. The Flash JSAPI is designed to resemble the Macromedia Dreamweaver and Macromedia Fireworks JavaScript API (which were designed based on the Netscape JavaScript API). The Flash JSAPI is based on a Document Object Model (DOM), which allows Flash documents to be accessed using JavaScript objects. The Flash JSAPI includes all elements of the Netscape JavaScript API, plus the Flash DOM. These added objects and their methods and properties are described in this document. You can use any of the elements of the native JavaScript language in a Flash script, but only elements that make sense in the context of a Flash document will have an effect.
You can use Macromedia Flash MX 2004 Professional or your preferred text editor to write or edit Flash JavaScript (JSFL) files. If you use Flash Professional, these files have a.jsfl extension by default. To make a script appear in the Commands menu, save its JSFL file in the following folder:
Windows 2000 or Windows XP:
C:\Documents and Settings\<user>\Local Settings\ Application Data\Macromedia\ Flash MX2004\<language>\Configuration\Commands Windows 98: C:\Windows\Application Data\Macromedia\Flash MX 2004\ <language>\ Configuration\Commands Mac OS X: Hard Drive/Users/<userName>/Library/Application Support/Macromedia/Flash MX 2004/ <language>/Configuration/Commands
JSFL files that create tools need to be stored in the Tools folder, which can be found in the following location:
C:\Documents and Settings\<user>\Local Settings\ Application Data\Macromedia\ Flash MX2004\<language>\Configuration\Tools Windows 98: C:\Windows\Application Data\Macromedia\Flash MX 2004\ <language>\ Configuration\Tools Mac OS X: Hard Drive/Users/<userName>/Library/Application Support/Macromedia/Flash MX 2004/ <language>/Configuration/Tools

Example

The following examples show two possible implementations of this function:
function configureTool() { theTool = fl.tools.activeTool; theTool.setToolName("myTool"); theTool.setIcon("myTool.png"); theTool.setMenuString("My Tool's menu string"); theTool.setToolTip("my tool's tool tip"); theTool.setOptionsFile( "mtTool.xml" ); } function configureTool() { theTool = fl.tools.activeTool; theTool.setToolName("ellipse"); theTool.setIcon("Ellipse.png"); theTool.setMenuString("Ellipse"); theTool.setToolTip("Ellipse"); theTool.showTransformHandles( true ); }

deactivate()

Usage function deactivate() { // statements } Parameters
This function is called when the tool becomes inactive; that is, when the active tool changes from this tool to another one. Use this function to perform any cleanup the tool needs.
Example function deactivate() { fl.trace( "Tool is no longer active" ); }

keyDown()

Usage function keyDown() { // statements } Parameters
This function is called when the tool is active and the user presses a key. The script should call tools.getKeyDown() to determine which key was pressed.
Example function keyDown() { fl.trace("key " + fl.tools.getKeyDown() + " was pressed"); }

keyUp()

Usage function keyUp() { // statements } Parameters
This function is called when the tool is active and a key is released.
Example function keyUp() { fl.trace("Key is released"); }

mouseDoubleClick()

Usage function mouseDoubleClick() { // statements } Parameters
This function is called when the mouse button is double-clicked on the Stage.
Example function mouseDblClk() { fl.trace("Mouse was double-clicked"); }

mouseDown()

Usage function mouseDown( [ pt ] ) { // statements } Parameters
The optional pt parameter is a point that specifies the location of the mouse when the button is pressed. It is passed to the function when the mouse button is pressed.

Description Stores specified data with a document. Stores specified data with the selected object(s). Adds an item from any open document or library to the specified Document object. Adds a new path between two points. Adds a new oval into the specified bounding rectangle. Adds a new publish profile and makes it the current one. Adds a new rectangle or rounded rectangle, fitting it into the specified bounds. Adds a new scene (Timeline object) as the next scene after the currently selected scene and makes the new scene the currently selected scene. Inserts a new empty text field. Aligns the selection. Use this method before using the document.screenOutline property. Arranges the selection on the Stage. Performs a break-apart operation on the current selection. Indicates whether Edit Symbols menu and functionality is enabled. Determines whether you can use the document.revert() or fl.revertDocument() method successfully. Determines whether you can use the document.testMovie() method successfully. Determines whether you can use the document.testScene() method successfully. Copies the current selection from the document to the Clipboard.
document.addNewLine() document.addNewOval() document.addNewPublishProfile() document.addNewRectangle()

document.addNewScene()

document.addNewText() document.align() document.allowScreens()
document.arrange() document.breakApart()

document.canEditSymbol()

document.canRevert()

document.canTestMovie()

document.canTestScene()

document.clipCopy()

document.clipCut()
Description Cuts the current selection from the document and writes it to the Clipboard. Pastes the contents of the Clipboard into the document. Closes the specified document. Converts lines to fills on the selected objects. Converts the selected Stage item(s) to a new symbol. Delete the currently active profile, if there is more than one. Deletes the current scene (Timeline object) and, if the deleted scene was not the last one, sets the next scene as the current Timeline object. Deletes the current selection on the Stage. Distributes the selection. Performs a distribute-to-layers operation on the current selection; equivalent to selecting Distribute to Layers. Checks the document for persistent data with the specified name. Duplicates the currently active profile and gives the duplicate version focus. Makes a copy of the currently selected scene, giving the new scene a unique name and making it the current scene. Duplicates the selection on the Stage. Makes the specified scene the currently selected scene for editing. Switches the authoring tool into the editing mode specified by the parameter. Exits from symbol-editing mode and returns focus to the next level up from the editing mode. Exports the currently active profile to a file. Exports the document to the specified file in the Flash SWF format. Identical to retrieving the value of the To Stage button in the Align panel. Retrieves the fill object of the selected shape or, if specified, the toolbar and Property inspector. Returns the stroke object of the selected shape or, if specified, the toolbar and Property inspector. Retrieves the value of the specified data.

document.clipPaste() document.close() document.convertLinesToFills() document.convertToSymbol() document.deletePublishProfile()

document.deleteScene()

document.deleteSelection() document.distribute() document.distributeToLayers()
document.documentHasData()
document.duplicatePublishProfile()
document.duplicateScene()
document.duplicateSelection() document.editScene()

document.enterEditMode()

document.exitEditMode()
document.exportPublishProfile() document.exportSWF()
document.getAlignToDocument()

document.getCustomFill()

document.getCustomStroke()
document.getDataFromDocument()
document.getElementProperty()
Description Gets the specified Element property for the current selection. Gets a specified TextAttrs property of the selected text objects. Gets the bounding rectangle of the current selection. Gets the currently selected text. Retrieves the current Timeline object in the document. Gets the location of the transformation point of the current selection. Converts the current selection to a group. Imports a profile from a file. Imports a SWF file into the document. Makes the size of the selected objects the same. Performs a mouse click from the arrow tool. Performs a double mouse click from the arrow tool. one Bzier point selected, this method moves all selected Bzier points on all selected paths by the specified amount.
document.getElementTextAttr()
document.getSelectionRect() document.getTextString() document.getTimeline() document.getTransformationPoint()
document.group() document.importPublishProfile() document.importSWF() document.match() document.mouseClick() document.mouseDblClk()
document.moveSelectedBezierPointsBy() If the selection contains at least one path with at least
document.moveSelectionBy()
Moves selected objects by a specified amount of distance. Optimizes smoothing for the current selection, allowing multiple passes, if specified, for optimal smoothing; equivalent to selecting Modify > Shape > Optimize. Publishes the document according to the active Publish Settings (see File > Publish Settings); equivalent to selecting File > Publish. Removes persistent data with the specified name that has been attached to the document. Removes persistent data with the specified name that has been attached to the selection. Renames the current profile. Renames the currently selected scene in the Scenes panel. Moves the specified scene before another specified scene. Resets the transformation matrix; equivalent to selecting Modify > Transform > Remove transform.
document.optimizeCurves()

document.publish()

document.removeDataFromDocument()
document.removeDataFromSelection()
document.renamePublishProfile() document.renameScene()

document.reorderScene()

document.resetTransformation()

The following example removes from the document the persistent data named "myData":
fl.getDocumentDOM().removeDataFromDocument("myData");
Usage document.removeDataFromSelection( name ) Parameters
The name parameter is a string that specifies the name of the persistent data to remove.
Removes persistent data with the specified name that has been attached to the selection. See document.addDataToSelection().
The following example removes from the selection the persistent data named "myData":
fl.getDocumentDOM().removeDataFromSelection("myData");
document.renamePublishProfile()
Usage document.renamePublishProfile( [profileNewName ] ) Parameters
The optional profileNewName parameter specifies the new name for the profile. The new name must be unique. If the name is not specified, a default name is provided.
A Boolean value: true if the name is changed successfully; false otherwise.
Renames the current profile.
The following example renames the current profile to a default name and displays it:
alert(fl.getDocumentDOM().renamePublishProfile());

document.renameScene()

Usage document.renameScene( name ) Parameters
The name parameter is a string that specifies the new name of the scene.
A Boolean value: true if the name is changed successfully; false otherwise. If the new name is not unique, for example, the method returns false.
Renames the currently selected scene in the Scenes panel. The new name for the selected scene must be unique.
The following example renames the current scene to "new name":
var success = fl.getDocumentDOM().renameScene("new name");
Usage document.reorderScene( sceneToMove, sceneToPutItBefore ) Parameters
The sceneToMove parameter is an integer that specifies which scene to move, with 0 (zero) being the first scene. The sceneToPutItBefore parameter is an integer that specifies the scene before which you want to move the scene specified by sceneToMove. Specify 0 (zero) for the first scene. For example, if you specify 1 for sceneToMove and 0 for sceneToPutItBefore, the second scene is placed before the first scene. Specify -1 to move the scene to the end.
Moves the specified scene before another specified scene.
The following example moves the second scene to before the first scene:

Property summary for the HalfEdge object The following properties are available for the halfEdge object:

halfEdge.id

Description Read-only; a unique integer identifier for the halfEdge object.

halfEdge.getEdge()

Usage halfEdge.getEdge() Parameters

An Edge object.

Gets the Edge object for the halfEdge object.
The following example illustrates getting an edge and a half edge for the specified shape.
var shape = fl.getDocumentDOM().selection[0]; var halfEdge = shape.edges[0].getHalfEdge(0); var edge = halfEdge.getEdge();

halfEdge.getNext()

Usage halfEdge.getNext() Parameters

A halfEdge object.

Gets the next half edge on the current contour.
Note: Although half edges have a direction and a sequence order, edges do not. Example
The following example stores the next half edge of the specified contour in the nextHalfEdge variable:
var shape = fl.getDocumentDOM().selection[0]; var hEdge = shape.edges[0].getHalfEdge( 0 ); var nextHalfEdge = hEdge.getNext();
halfEdge.getOppositeHalfEdge()
Usage halfEdge.getOppositeHalfEdge() Parameters
Gets the halfEdge object on the other side of the edge.
The following example stores the half edge opposite hEdge in the otherHalfEdge variable:
var shape = fl.getDocumentDOM().selection[0]; var hEdge = shape.edges[0].getHalfEdge(0); var otherHalfEdge = hEdge.getOppositeHalfEdge();

halfEdge.getPrev()

Usage halfEdge.getPrev() Parameters
Gets the preceding halfEdge object on the current contour.
The following example stores the previous half edge of the specified contour in the prevHalfEdge variable:
var shape = fl.getDocumentDOM().selection[0]; var hEdge = shape.edges[0].getHalfEdge( 0 ); var prevHalfEdge = hEdge.getPrev();

halfEdge.getVertex()

Usage halfEdge.getVertex() Parameters

A Vertex object.

Gets the Vertex object at the head of the halfEdge object.
The following example stores the Vertex object at the head of hEdge in the vertex variable:
var var var var shape = fl.getDocumentDOM().selection[0]; edge = shape.edges[0]; hEdge = edge.getHalfEdge(0); vertex = hEdge.getVertex();
Usage halfEdge.id Description
Read-only property; a unique integer identifier for the halfEdge object.
The following example displays a unique identifier for the specified half edge in the Output panel:

A string value for the property.
Gets the property for the selected item.
The following example shows a dialog box that contains the Linkage Identifier value for the symbol when referencing it using ActionScript or for runtime sharing:
alert(fl.getDocumentDOM().library.getItemProperty("linkageIdentifier"));

library.getItemType()

Usage library.getItemType( [ namePath ] ) Parameters
A string that specifies the name of the item. If the item is in a folder, specify its name and path using slash notation. If namePath is not specified, Flash provides the type of the current selection. If more than one item is currently selected and no namePath is provided, Flash ignores the command. This parameter is optional.
A string value specifying the type of object. Possible values include: "undefined", "component", "movie clip", "graphic", "button", "video", "folder", "font", "sound", "bitmap", and "compiled clip".
Gets the type of object currently selected or specified by a library path.
The following example shows a dialog box that contains the item type of Symbol_1 located in the Folder_1/Folder_2 folder:
alert(fl.getDocumentDOM.library.getItemType("Folder_1/Folder_2/Symbol_1"));
An array of values for all currently selected items in the library.
Gets the array of all currently selected items in the library.
The following example stores the array of currently selected library items (in this case, several audio files) in the selItems variable and then changes the sampleRate property of the first audio file in the array to "11 kHz":
var selItems = fl.getDocumentDOM().library.getSelectedItems(); selItems[0].sampleRate = "11 kHz";
library.importEmbeddedSWF()
Usage library.importEmbeddedSWF( linkageName, swfData [, libName] ) Parameters linkageName swfData
A string that provides the name of the SWF linkage of the root movie clip.
An array of binary SWF data, which comes from an external library or DLL.
libName A string that specifies the library name for the created item. If the name is already used, the method creates an alternate name. This parameter is optional. Returns

symbolInstance.colorBluePercent
symbolInstance.colorGreenAmount
symbolInstance.colorGreenPercent Part of the color transformation for the instance; equivalent to

symbolInstance.colorMode

Description A string that specifies the color mode as identified in the symbol Property inspector Color pop-up menu. An integer that is part of the color transformation for the instance, equivalent to using the Color > Advanced setting in the Instance Property inspector. Part of the color transformation for the instance; equivalent to using the Color > Advanced setting in the Instance Property inspector (the percentage controls on the left of the dialog box). A string that is equivalent to the Description field on the Accessibility panel. A zero-based integer that specifies the first frame to appear in the Timeline of the graphic. A Boolean value that enables and disables the accessibility of the objects children; equivalent to the inverse logic of the Make Child Objects Accessible setting in the Accessibility panel. A string that, for graphic symbols, sets the same property as the Loop pop-up menu in the Property inspector. A string that is equivalent to the shortcut key associated with the symbol; equivalent to the Shortcut field on the Accessibility panel. A Boolean value that enables or disables the accessibility of the object; equivalent to the inverse logic of the Make Object Accessible setting in the Accessibility panel. A string that specifies the type of symbol; equivalent to the value for Behavior in the Create New Symbol and Convert To Symbol dialog boxes. An integer that is equivalent to the Tab index field on the Accessibility panel.
symbolInstance.colorRedAmount
symbolInstance.colorRedPercent
symbolInstance.description
symbolInstance.firstFrame
symbolInstance.forceSimple

symbolInstance.loop

symbolInstance.shortcut

symbolInstance.silent

symbolInstance.symbolType

symbolInstance.tabIndex

Usage symbolInstance.accName Description
A string that is equivalent to the Name field in the Accessibility panel. Screen readers identify objects by reading the name aloud. This property is not available for graphic symbols.
The following example stores the value for the Accessibility panel name of the object in the theName variable:
var theName = fl.getDocumentDOM().selection[0].accName;
The following example sets the value for the Accessibility panel name of the object to "Home Button":
fl.getDocumentDOM().selection[0].accName = "Home Button";
symbolInstance.actionScript
Usage symbolInstance.actionScript Description
A string that specifies the actions assigned to the symbol. This applies only to movie clip and button instances. For a graphic symbol instance, the value returns undefined.
The following example assigns an onClipEvent action to the first item in the first frame of the first layer of the Timeline:

A string that is equivalent to the Description field on the Accessibility panel. The description is read by the screen reader. This property is not available for graphic symbols.
The following example stores the value for the Accessibility panel description of the object in the theDescription variable:
var theDescription = fl.getDocumentDOM().selection[0].description;
The following example sets the value for the Accessibility panel description to Click the home button to go to home:
fl.getDocumentDOM().selection[0].description= "Click the home button to go to home";
Usage symbolInstance.firstFrame Description
A zero-based integer that specifies the first frame to appear in the Timeline of the graphic. This property applies only to graphic symbols and sets the same property as the First field in the Property inspector. For other types of symbols, this property is undefined.
The following example specifies that frame 11 should be the first frame to appear in the Timeline of the specified element:
fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0].firstFrame = 10;
Usage symbolInstance.forceSimple Description
A Boolean value that enables and disables the accessibility of the objects children; equivalent to the inverse logic of the Make Child Objects Accessible setting in the Accessibility panel. For example, if forceSimple is true, it is the same as the Make Child Object Accessible option being unchecked. If forceSimple is false, it is the same as the Make Child Object Accessible option being checked. This property is available only for movie clip objects.
The following example checks to see if the children of the object are accessible; a return value of false means the children are accessible:
var areChildrenAccessible = fl.getDocumentDOM().selection[0].forceSimple;
The following example allows the children of the object to be accessible:
fl.getDocumentDOM().selection[0].forceSimple = false;
Usage symbolInstance.loop Description
A string that, for graphic symbols, sets the same property as the Loop pop-up menu in the Property inspector. For other types of symbols, this property is undefined. Acceptable values are "loop", "play once", and "single frame" to set the graphics animation accordingly.
The following example sets the first symbol in the first frame of the first layer in the Timeline to Single Frame (display one specified frame of the graphic Timeline), as long as that symbol is a graphic:
fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0].loop = 'single frame';
Usage symbolInstance.shortcut Description
A string that is equivalent to the shortcut key associated with the symbol; equivalent to the Shortcut field on the Accessibility panel. This key is read by the screen readers. This property is not available for graphic symbols.

The following example stores the value for the shortcut key of the object in the theShortcut variable:
var theShortcut = fl.getDocumentDOM().selection[0].shortcut;
The following example sets the shortcut key of the object to "Ctrl+i":
fl.getDocumentDOM().selection[0].shortcut = "Ctrl+i";
Usage symbolInstance.silent Description
A Boolean value that enables or disables the accessibility of the object; equivalent to the inverse logic of the Make Object Accessible setting in the Accessibility panel. For example, if silent is true, it is the same as the Make Object Accessible option being unchecked. If silent is false, it is the same as the Make Object Accessible option being checked. This property is not available for graphic objects.
The following example checks to see if the object is accessible; a return value of false means the object is accessible:
var isSilent = fl.getDocumentDOM().selection[0].silent;
fl.getDocumentDOM().selection[0].silent = false;
Usage symbolInstance.symbolType
A string that specifies the type of symbol; equivalent to the value for Behavior in the Create New Symbol and Convert To Symbol dialog boxes. Acceptable values are "button", "movie clip", and "graphic".
The following example sets the first symbol in the first frame of the first layer in the Timeline of the current document to behave as a graphic symbol:
fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0].symbolType = "graphic";
Usage symbolInstance.tabIndex Description
An integer that is equivalent to the Tab index field on the Accessibility panel. Creates a tab order in which objects are accessed when the user presses the Tab key. This property is not available for graphic symbols.
The following example sets the tabIndex property of the mySymbol object to 3 and displays that value in the Output panel:
var mySymbol = fl.getDocumentDOM().selection[0]; mySymbol.tabIndex = 3; fl.trace(mySymbol.tabIndex);

The following example sets the value of the maxCharacters property to 30:
fl.getDocumentDOM().selection[0].maxCharacters = 30;

text.orientation

Usage text.orientation Description
Property; a string that specifies the orientation of the text field. Acceptable values are "horizontal", "vertical left to right", and "vertical right to left". This property works only with static text; if used with other text types, the property generates a warning.
The following example sets the orientation property to "vertical right to left":
fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0].orientation = "vertical right to left";

text.renderAsHTML

Usage text.renderAsHTML Description
Property; a Boolean value. If the value is true, Flash draws the text as HTML and interprets embedded HTML tags. This property works only with dynamic or input text; it generates a warning if used with other text types.
The following example sets the renderAsHTML property to true:
fl.getDocumentDOM().selection[0].renderAsHTML = true;
Usage text.scrollable Description
Property; a Boolean value. If the value is true, the text can be scrolled.
This property works only with dynamic or input text; it generates a warning if used with static text.
The following example sets the scrollable property to false:
fl.getDocumentDOM().selection[0].scrollable = false;
Usage text.selectable Description
Property; a Boolean value. If the value is true, the text can be selected. Input text is always selectable. When set to false and used with input text, this property generates a warning.
The following example sets the selectable property to true:
fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0].selectable = true;
Usage text.selectionEnd Description
Property; a zero-based integer that specifies the end of a text subselection. For more information, see text.selectionStart. text.selectionStart
Usage text.selectionStart Description
Property; a zero-based integer that specifies the beginning of a text subselection. You can use this property with text.selectionEnd to select a range of characters. Characters up to but not including text.selectionEnd are selected.

Property summary for the Timeline object The following methods are available for the Timeline object.

timeline.currentFrame

Description A zero-based index for the frame at the current playhead location. A zero-based index for the currently active layer.

timeline.currentLayer

timeline.frameCount
Description Read-only; an integer that represents the number of frames in this Timelines longest layer. Read-only; an integer that represents the number of layers in the specified Timeline. Read-only; an array of layer objects. A string that represents the name of the current Timeline.

timeline.layerCount

timeline.layers timeline.name
Usage timeline.addMotionGuide() Parameters
An integer that represents the zero-based index of the newly added guide layer. If the current layer type is not of type Normal, Flash returns -1.
Method; adds a motion guide layer above the current layer and attaches the current layer to the newly added guide layer, converting the current layer to a layer of type Guided. This method functions only on a layer of type Normal. It has no effect on a layer whose type is Folder, Mask, Masked, Guide, or Guided.
The following example adds a motion guide layer above the current layer, and converts the current layer to "Guided":
fl.getDocumentDOM().getTimeline().addMotionGuide();
Usage timeline.addNewLayer([name] [, layerType [, bAddAbove]]) Parameters name A string that specifies the name for the new layer. If you omit this parameter, a new default layer name is assigned to the new layer (Layer n, where n is the total number of layers). This parameter is optional.

layerType

A string that specifies the type of layer to add. If you omit this parameter, a Normal type layer is created. This parameter is optional.
bAddAbove A Boolean value that, if set to true (the default), causes Flash to add the new layer above the current layer; false causes Flash to add the layer below the current layer. This parameter is optional. Returns
An integer value of the zero-based index of the newly added layer.
Method; adds a new layer to the document and makes it the current layer.
The following example adds a new layer to the Timeline with a default name generated by Flash:
fl.getDocumentDOM().getTimeline().addNewLayer();
The following example adds a new folder layer on top of the current layer and names it "Folder1":
fl.getDocumentDOM().getTimeline().addNewLayer("Folder1", "folder", true);
Usage timeline.clearFrames([startFrameIndex [, endFrameIndex]]) Parameters startFrameIndex A zero-based index that defines the beginning of the range of frames to clear. If you omit startFrameIndex, the method uses the current selection. This parameter is optional. endFrameIndex A zero-based index that defines the end of the range of frames to clear. The range goes up to, but does not include, endFrameIndex. If you specify only startFrameIndex, endFrameIndex defaults to the value of startFrameIndex. This parameter is optional. Returns

(mmEnv.objectType

? (*(mmEnv.objectType))(o) : (unsigned short *)0)
/* JSObject *JS_NewArrayObject(JSContext *cx, unsigned int length, jsval *v) */ #define JS_NewArrayObject(c, l, v) \ (mmEnv.newArrayObject ? (*(mmEnv.newArrayObject))(c, l, v) : (JSObject *)0) /* long JS_GetArrayLength(JSContext *cx, JSObject *obj) */ #define JS_GetArrayLength(c, o) \ (mmEnv.getArrayLength ? (*(mmEnv.getArrayLength))(c, o) : -1) /* JSBool JS_GetElement(JSContext *cx, JSObject *obj, jsint idx, jsval *vp) */ #define JS_GetElement(c, o, i, v) \ (mmEnv.getElement ? (*(mmEnv.getElement))(c, o, i, v) : JS_FALSE) /* JSBool JS_SetElement(JSContext *cx, JSObject *obj, jsint idx, jsval *vp) */ #define JS_SetElement(c, o, i, v) \ (mmEnv.setElement ? (*(mmEnv.setElement))(c, o, i, v) : JS_FALSE) /* JSBool JS_ExecuteScript(JSContext *cx, JSObject *obj, unsigned short *script, * unsigned int sz, jsval *rval) */ #define JS_ExecuteScript(c, o, s, z, r) \ (mmEnv.executeScript ? (*(mmEnv.executeScript))(c, o, s, z, _T(__FILE__), \ __LINE__, r) : JS_FALSE) /* JSBool JS_ReportError(JSContext *cx, unsigned short *error, unsigned int sz) */ #define JS_ReportError(c, e, s) \ (mmEnv.reportError ? (*(mmEnv.reportError))(c, e, s) : JS_FALSE)
/***************************************************************************** * Private data types, macros, and globals ****************************************************************************/ typedef struct { JSObject *libObj; JSBool (*defineFunction)(JSObject *libObj, unsigned short *name, JSNative call, unsigned int nargs); unsigned short *(*valueToString)(JSContext *cx, jsval v, unsigned int *pLength); unsigned char *(*valueToBytes)(JSContext *cx, jsval v, unsigned int *pLength); JSBool (*valueToInteger)(JSContext *cx, jsval v, long *lp); JSBool (*valueToDouble)(JSContext *cx, jsval v, double *dp); JSBool (*valueToBoolean)(JSContext *cx, jsval v, JSBool *bp); JSBool (*valueToObject)(JSContext *cx, jsval v, JSObject **op); JSBool (*stringToValue)(JSContext *cx, unsigned short *b, unsigned int sz, jsval *vp); JSBool (*bytesToValue)(JSContext *cx, unsigned char *b, unsigned int sz, jsval *vp); JSBool (*doubleToValue)(JSContext *cx, double dv, jsval *vp); unsigned short *(*objectType)(JSObject *obj); JSObject *(*newArrayObject)(JSContext *cx, unsigned int length, jsval *vp); long (*getArrayLength)(JSContext *cx, JSObject *obj); JSBool (*getElement)(JSContext *cx, JSObject *obj, unsigned int idx, jsval *vp);

doc1

You can use Macromedia Flash MX 2004 Professional or your preferred text editor to write or edit Flash JavaScript (JSFL) files. If you use Flash Professional, these files have a.jsfl extension by default. To make a script appear in the Commands menu, save its JSFL file in the following folder:
Windows 2000 or Windows XP:
C:\Documents and Settings\user\Local Settings\ Application Data\Macromedia\ Flash MX2004\language\Configuration\Commands

Windows 98:

C:\Windows\Application Data\Macromedia\Flash MX 2004\language\ Configuration\Commands

Mac OS X:

Hard Drive/Users/userName/Library/Application Support/Macromedia/Flash MX 2004/ language/Configuration/Commands JSFL files that create tools need to be stored in the Tools folder, which can be found in the following location:
C:\Documents and Settings\user\Local Settings\ Application Data\Macromedia\ Flash MX2004\language\Configuration\Tools
C:\Windows\Application Data\Macromedia\Flash MX 2004\language\Configuration\Tools
Hard Drive/Users/userName/Library/Application Support/Macromedia/Flash MX 2004/ language/Configuration/Tools If a JSFL file has other files that go with it, such as XML files, they should be stored in the same directory as the JSFL file. You can also create a JSFL file by selecting one or more commands in the History panel and then clicking the Save As Command button in the History panel or selecting the Save As Command from the Options pop-up menu. The command (JSFL) file is saved in the Commands folder. You can then open the file and edit it the same as any other script file.
To run a script, do one of the following:
Select Commands > Command Name. Select Commands > Run Command and then select the script to run.
To add a tool implemented in a JSFL file to the Flash Tools panel:
1. Copy the JSFL file for the tool and any other associated files to the Tools folder. 2. Select Edit > Customize Tools Panel (Windows) or Flash > Customize Tools Panel

(Macintosh).

3. Add the tool to the list of available tools. 4. Click OK.

Chapter 1: Introduction

You can embed individual JSAPI commands in ActionScript files by using the MMExecute() command, which is documented in the Flash MX 2004 ActionScript Language Reference. However, the MMExecute() command has an effect only when it is used in the context of a custom userinterface element, such as a component Property inspector, or a SWF panel within the authoring environment. Even if called from ActionScript, JSAPI commands have no effect in Flash Player or outside the authoring environment. The JSAPI also contains a number of methods that let you implement extensibility using a combination of JavaScript and custom C code. For more information, see Chapter 4, C-Level Extensibility, on page 369. Flash JavaScript objects contain properties and methods. Properties, each defined as a primitive type such as Boolean, integer, array, float, or reference data types such as color, object, point, rect, and String, are used to describe the object. Methods are used to perform a function on the object. To access the properties or methods of an object, dot notation is used. Also, most objects have getProperty() and setProperty() methods, which get the value for a specified property or set the value for a specified property. Most methods take parameters that are used to specify different options for the method. The JavaScript interpreter in Flash is the Mozilla SpiderMonkey engine, version 1.5, which is available on the web at http://www.mozilla.org/js/spidermonkey/. SpiderMonkey is one of the two reference implementations of the JavaScript language developed by Mozilla.org. It is the same engine that is embedded in the Mozilla browser. SpiderMonkey implements the entire core JavaScript language as defined in the ECMA-262 specification. It is fully compliant with ECMA-262 Edition 3. Only the browser-specific host objects, which are not part of the ECMA-262 specification, are not supported. All Core JavaScript sections of Netscapes JavaScript documentation at http:// devedge.netscape.com/central/javascript/ apply to the Flash JavaScript interpreter. All ClientSide JavaScript sections do not apply because they only apply to browser environments. SpiderMonkey is also used in Fireworks MX 2004, Dreamweaver MX 2004, Director MX 2004 and Flash Communication Server MX.

mouseMove()

Usage function mouseMove( [ pt ] ) { // statements } Parameters pt A point that specifies the current location of the mouse. It is passed to the function whenever the mouse moves, which tracks the mouse location. If the Stage is in edit or edit-in-place mode, the point coordinates are relative to the object being edited. Otherwise, the point coordinates are relative to the Stage. This parameter is optional. Returns
This function is called whenever the mouse moves over a specified point on the Stage. The mouse button can be down or up.
Example function mouseMove() { fl.trace("moving"); }

mouseUp()

Usage function mouseUp() { // statements } Parameters
This function is called whenever the mouse button is released after being pressed on the Stage.
Example function mouseUp() { fl.trace("mouse is up"); }

notifySettingsChanged()

Usage function notifySettingsChanged() { // statements } Parameters
This function is called whenever a tool is active and the user changes its options in the Property inspector. You can use the tools.activeTool property to query the current values of the options.
Example function notifySettingsChanged() { var theTool = fl.tools.activeTool; var newValue = theTool.myProp; }

removeEffect()

Usage function removeEffect() { // statements } Parameters
This function is called when the user changes an effect's properties or uses the "remove effect" menu item. The code contained in this function is responsible for returning the object(s) to their original state. For example, if the effect broke a text string apart, the responsibility of the removeEffect() method would be to remove the text string that was broken apart and replace it with the original string.
See also configureEffect(), executeEffect()

setCursor()

Usage function setCursor() { // statements } Parameters
This function is called whenever the mouse moves, to allow the script to set custom pointers. The script should call tools.setCursor() to specify the pointer to use. For a list that shows which pointers correspond to which integer values, see tools.setCursor().
Example function setCursor() { fl.tools.setCursor( 1 ); }

CHAPTER 3 Objects

This chapter describes the Flash JSAPI objects, listed in alphabetical order. The objects are listed in the following table:
Object BitmapInstance object BitmapItem object CompiledClipInstance object ComponentInstance object componentsPanel object Description The BitmapInstance object is a subclass of the Instance object and represents a bitmap in a frame. A BitmapItem object refers to a bitmap in the library of a document. The BitmapItem object is a subclass of the Item object. The CompiledClipInstance object is a subclass of the Instance object. The ComponentInstance object is a subclass of the SymbolInstance object and represents a component in a frame. The componentsPanel object, which represents the Components panel, is a property of the flash object and can be accessed by fl.componentsPanel. A Contour object represents a closed path of half edges on the boundary of a shape. The Document object represents the Stage. The drawingLayer object is accessible from JavaScript as a child of the flash object. The Edge object represents an edge of a shape on the Stage. The Effect object represents an instance of a Timeline effect. Everything that appears on the Stage is of the type Element. The EmbeddedVideoInstance object is a subclass of the Instance object. The Fill object contains all the properties of the Fill color setting of the Tools panel or of a selected shape. The flash object represents the Flash application. The folderItem object is a subclass of the Item object.

compiledClipInstance.accName
Description Property; a string that is equivalent to the Name field in the Accessibility panel.
compiledClipInstance.actionScript Property; a string that represents the ActionScript for this instance; equivalent to symbolInstance.actionScript. compiledClipInstance.description
Property; a string that is equivalent to the Description field in the Accessibility panel. Property; a Boolean value that enables and disables the children of the object to be accessible. Property; a string that is equivalent to the Shortcut field in the Accessibility panel. Property; a Boolean value that enables or disables the accessibility of the object; equivalent to the inverse logic of Make Object Accessible setting in the Accessibility panel. Property; an integer that is equivalent to the Tab Index field in the Accessibility panel.
compiledClipInstance.forceSimple
compiledClipInstance.shortcut
compiledClipInstance.silent
compiledClipInstance.tabIndex
Usage compiledClipInstance.accName Description
Property; a string that is equivalent to the Name field in the Accessibility panel. Screen readers identify objects by reading the name aloud.
Example // get the name of the object. var theName = fl.getDocumentDOM().selection[0].accName; // set the name of the object. fl.getDocumentDOM().selection[0].accName = 'Home Button';
compiledClipInstance.actionScript
Usage compiledClipInstance.actionScript Description
Property; a string that represents the ActionScript for this instance; equivalent to symbolInstance.actionScript.
The following code assigns ActionScript to specified elements:
//assign some ActionScript to a specified Button compiled clip instance. fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0].actionScript = "on(click) {trace('button is clicked');}"; //assign some ActionScript to the currently selected Button compiled clip instance. fl.getDocumentDOM().selection[0].actionScript = "on(click) {trace('button is clicked');}";

document.setInstanceAlpha() document.setInstanceBrightness() document.setInstanceTint() document.setSelectionBounds() document.setSelectionRect()
document.setStroke() document.setStrokeColor()

document.setStrokeSize()

document.setStrokeStyle()
document.setTextRectangle()
document.setTextSelection()
Description Sets the text selection of the currently selected text field to the values specified by the startIndex and endIndex values. Inserts a string of text. Moves the transformation point of the current selection. Skews the selection by a specified amount. Smooths the curve of each selected fill outline or curved line. Spaces the objects in the selection evenly. Straightens the currently selected strokes; equivalent to using the Straighten button in the Tools panel. Swaps the current selection with the specified one. Executes a Test Movie operation on the document. Executes a Test Scene operation on the current scene of the document. Performs a trace bitmap on the current selection; equivalent to selecting Modify > Bitmap > Trace Bitmap. Performs a general transformation on the current selection by applying the matrix specified in the arguments. Ungroups the current selection. Unlocks all locked elements on the currently selected frame. Posts a XMLUI dialog box.
document.setTextString() document.setTransformationPoint() document.skewSelection() document.smoothSelection()
document.space() document.straightenSelection()
document.swapElement() document.testMovie() document.testScene()

document.traceBitmap()

document.transformSelection()
document.unGroup() document.unlockAllElements()

document.xmlPanel()

Property summary for the Document object You can use the following properties with the Document object.

document.accName

Description A string that is equivalent to the Name field in the Accessibility panel. A Boolean value that is equivalent to the Auto Label check box in the Accessibility panel. A color in hexidecimal format that represents the background color. A string that specifies the name of the active publish profile for the specified document. An integer that specifies the index of the active Timeline.

document.autoLabel

document.backgroundColor
document.currentPublishProfile

document.currentTimeline

document.description
Description A string that is equivalent to the Description field in the Accessibility panel. A Boolean value that specifies whether the children of the specified object are accessible. A float value that specifies the number of frames displayed per second when the SWF file plays; the default is 12. An integer that specifies the height of the document (Stage) in pixels. Read-only; the library object for a document. A Boolean value that specifies if Live Preview is enabled. Read-only; a string that represents the name of a document (FLA file). Read-only; a string that represents the path of the document. Read-only; an array of the publish profile names for the document. Read-only; the current ScreenOutline object for the document. An array of the selected objects in the document. A Boolean value that specifies whether the object is accessible. Read-only; an array of Timeline objects (see Timeline object). Read-only; a Matrix object. An integer that specifies the width of the document (Stage) in pixels.

Method; makes a copy of the currently selected scene, giving the new scene a unique name and making it the current scene.
The following example duplicates the second scene in the current document:
fl.getDocumentDOM().editScene(1); //set the middle scene to current scene var success = fl.getDocumentDOM().duplicateScene();
document.duplicateSelection()
Usage document.duplicateSelection() Parameters
Method; duplicates the selection on the Stage.
The following example duplicates the current selection, which is similar to Alt-clicking and then dragging an item:
fl.getDocumentDOM().duplicateSelection();

document.editScene()

Usage document.editScene( index ) Parameters index Returns
A zero-based integer that specifies which scene to edit.
Method; makes the specified scene the currently selected scene for editing.
Assuming that there are three scenes (Scene0, Scene1, and Scene2) in the current document, the following example makes Scene2 the current scene and then deletes it:
fl.getDocumentDOM().editScene(2); fl.getDocumentDOM().deleteScene();
Usage document.enterEditMode( [editMode] ) Parameters editMode "newWindow".
A string that specifies the editing mode. Valid values are "inPlace" or If no parameter is specified, the default is symbol-editing mode. This parameter is

optional.

Method; switches the authoring tool into the editing mode specified by the parameter. If no parameter is specified, the method defaults to symbol-editing mode, which has the same result as right-clicking the symbol to invoke the context menu and selecting Edit. See document.exitEditMode().
The following example puts Flash in edit-in-place mode for the currently selected symbol:
fl.getDocumentDOM().enterEditMode('inPlace');
The following example puts Flash in edit-in-new-window mode for the currently selected symbol:
fl.getDocumentDOM().enterEditMode('newWindow');
Usage document.exitEditMode() Parameters
Method; exits from symbol-editing mode and returns focus to the next level up from the editing mode. For example, if you are editing a symbol inside another symbol, this method takes you up a level from the symbol you are editing, into the parent symbol. See document.enterEditMode().

Method; saves the document in its default location. This method is equivalent to selecting File > Save. See document.saveAndCompact(), fl.saveDocumentAs(), fl.saveDocument(), and fl.saveAll().
The following example saves the current document in its default location:
fl.getDocumentDOM().save();
Usage document.saveAndCompact( [bOkToSaveAs] ) Parameters bOkToSaveAs
An optional parameter that, if true or omitted and the file was never saved, the Save As dialog box appears. If false and the file was never saved, the file is not saved.
A Boolean value: true if the save-and-compact operation completes successfully; false otherwise.
Method; saves and compacts the file. This method is equivalent to selecting File > Save and Compact. See document.save(), fl.saveDocumentAs(), fl.saveDocument(), and fl.saveAll().
The following example saves and compacts the current document:
fl.getDocumentDOM().saveAndCompact();
Usage document.scaleSelection( xScale, yScale [, whichCorner] )

Parameters xScale yScale

A floating point value that specifies the amount of x by which to scale. A floating point value that specifies the amount of y by which to scale.
whichCorner A string value that specifies the edge about which the transformation occurs. If omitted, scaling occurs about the transformation point. Acceptable values are: "bottom left", "bottom right", "top right", "top left", "top center", "right center", "bottom center", and "left center". This parameter is optional. Returns
Method; scales the selection by a specified amount. This method is equivalent to using the Free Transform tool to scale the object.
The following example expands the width of the current selection to double the original width and shrinks the height to half:
flash.getDocumentDOM().scaleSelection(2.0, 0.5);
The following example flips the selection vertically:
fl.getDocumentDOM().scaleSelection(1, -1);
The following example flips the selection horizontally:
fl.getDocumentDOM().scaleSelection(-1, 1);
The following example scales the selection vertically by 1.9 from the top center:
fl.getDocumentDOM().scaleSelection(1, 1.90, 'top center');

fl.getDocumentDOM().swapElement('Symbol 1');

document.testMovie()

Usage document.testMovie() Parameters
Method; executes a Test Movie operation on the document. See document.canTestMovie() and document.testScene().
The following example tests the movie for the current document:
fl.getDocumentDOM().testMovie();

document.testScene()

Usage document.testScene() Parameters
Method; executes a Test Scene operation on the current scene of the document. See document.canTestScene() and document.testMovie().
The following example tests the current scene in the document:
fl.getDocumentDOM().testScene();
Usage document.timelines Description
Read-only property; an array of Timeline objects (see Timeline object). See document.getTimeline() and document.currentTimeline.
The following example gets the array of current Timelines in the active document and displays their names in the Output panel:
var i = 0; var curTimelines = fl.getDocumentDOM().timelines; while(i < fl.getDocumentDOM().timelines.length){ alert(curTimelines[i].name); ++i; }
Usage document.traceBitmap( threshold, minimumArea, curveFit, cornerThreshold ) Parameters threshold
An integer that controls the number of colors in your traced bitmap. Valid values are integers between 0 and 500.
minimumArea An integer that specifies the radius measured in pixels. Valid values are integers between 1 and 1000. curveFit "very tight", "tight", "normal", "smooth",
A string that specifies how smoothly outlines are drawn. Valid values are: "pixels", and "very smooth".
cornerThreshold A string that is similar to curveFit, but it pertains to the corners of the bitmap image. Valid values are: "many corners", "normal", and "few corners". Returns
Method; performs a trace bitmap on the current selection. This method is equivalent to selecting Modify > Bitmap > Trace Bitmap.
The following example traces the selected bitmap, using the specified parameters:
fl.getDocumentDOM().traceBitmap(0, 500, 'normal', 'normal');
Usage document.transformSelection( a, b, c, d) Parameters a b c d
A floating point number that specifies the (0,0) element of the transformation matrix. A floating point number that specifies the (0,1) element of the transformation matrix. A floating point number that specifies the (1,0) element of the transformation matrix. A floating point number that specifies the (1,1) element of the transformation matrix.

fl.configDirectory

fl.configURI

fl.createNewDocList

fl.createNewDocListType

fl.createNewTemplateList

fl.documents

fl.drawingLayer

fl.effects

fl.Math

fl.mruRecentFileList

fl.mruRecentFileListType

fl.outputPanel fl.tools fl.version

fl.xmlui

fl.activeEffect
Usage fl.activeEffect Description
Read-only property; the Effect object for the current effect being applied. For a list of properties available to fl.activeEffect, see Property summary for the Effect object on page 146.
The following example stores an object that represents the current effect in the ef variable.
var ef = fl.activeEffect;
Usage fl.browseForFileURL( browseType [, title [, previewArea ] ]) Parameters browseType "select"
A string that specifies the type of file browse operation. Valid values are "open", or "save". The values "open" and "select" open the system File Open dialog box. Each value is provided for compatibility with Dreamweaver. The value "save" opens a system File Save dialog box.
A string that specifies the title for the File Open or File Save dialog box. If this parameter is omitted, a default value is used. This parameter is optional.

previewArea

An optional parameter that is ignored by Flash and Fireworks and is present only for compatibility with Dreamweaver.
A string containing the URL of the file.
Method; opens a File Open or File Save system dialog box and lets the user specify a file to be opened or saved.
The following example lets the user choose a FLA file to open and then opens the file. (The fl.browserForFileURL() method can browse for any type of file, but fl.openDocument() can open only FLA files.)
var fileURL = fl.browseForFileURL("open", "Select file"); var doc = fl.openDocument(fileURL);
Usage fl.closeAll() Parameters
Method; closes all open documents, displaying the Save As dialog box for any documents that were not previously saved. The method prompts the user, if necessary, but does not terminate the application. See also fl.closeDocument().
The following code closes all open documents.

fl.closeAll();

fl.closeDocument()
Usage fl.closeDocument( documentObject [, bPromptToSaveChanges] ) Parameters documentObject,

[ bPromptToSaveChanges ]

documentObject A Document object. If documentObject refers to the active document, the Document window might not close until the script that calls this method finishes executing. bPromptToSaveChanges A Boolean value. If it is false, the user is not prompted if the document contains unsaved changes; that is, the file is closed and the changes are discarded. If the value is true, and if the document contains unsaved changes, the user is prompted with the standard yes-or-no dialog box. The default value is true. This parameter is optional. Returns

The following example displays the number of recently opened files, and the type of each file, in the Output panel.
fl.trace("Number of recently opened files: " + fl.mruRecentFileListType.length); for (i = 0; i < fl.mruRecentFileListType.length; i++) fl.trace("type: " + fl.mruRecentFileListType[i]);

fl.openDocument()

Usage fl.openDocument( fileURI ) Parameters fileURI
A string that specifies the name of the file to be opened, expressed as a URI (file:///
If successful, returns the Document object for the newly opened document. If the file is not found, or is not a valid FLA file, an error is reported and the script is cancelled.
Method; opens a Flash document (FLA file) for editing in a new Flash Document window and gives it the focus. For a user, the effect is the same as selecting File > Open and then selecting a file. If the specified file is already open, the window that contains the document comes to the front. The window that contains the specified file becomes the currently selected document.
The following example opens a file named Document.fla that is stored in the root directory of the C drive, stores a Document object representing that document in the doc variable, and sets the document to be the currently selected document. That is, until focus is changed, fl.getDocumentDOM() refers to this document.
var doc = fl.openDocument("file:///c|/Document.fla");

fl.openProject()

Usage fl.openProject( fileURI ) Parameters fileURI
A string that specifies the path of the Flash project file to open, expressed as a URI (file:///URI).
Method; opens a Flash Project (FLP) file in the authoring tool for editing.
The following example opens a project file named myProjectFile.flp that is stored in the root directory of the C drive.
fl.openProject("file:///c|/myProjectFile.flp");

fl.openScript()

Usage fl.openScript( fileURI ) Parameters fileURI
A string that specifies the path of the JSFL, AS, ASC, XML, TXT or other file that should be loaded into the Flash text editor, expressed as a URI (file:///URI).
Method; opens a script (JSFL, AS, ASC) or other file (XML, TXT) in the Flash text editor.
The following example opens a file named my_test.jsfl that is stored in the /temp directory of the C drive.
fl.openScript("file:///c|/temp/my_test.jsfl");

fl.outputPanel

Usage fl.outputPanel Description
Read-only property; reference to the outputPanel object.

alert(fl.getDocumentDOM().library.itemExists('Folder_1/Symbol_1'));
Usage library.items Description
Property; an array of item objects in the library.
The following example stores the array of all library items in the itemArray variable:
var itemArray = fl.getDocumentDOM().library.items;

library.moveToFolder()

Usage library.moveToFolder( folderPath [, itemToMove [, bReplace ] ] ) Parameters folderPath folderPath. itemToMove A string that specifies the name of the item to move. If itemToMove is not specified, the currently selected items move. This parameter is optional. bReplace A Boolean value. If an item with the same name already exists, specifying true for the bReplace parameter replaces the existing item with the item being moved. If false, the name of the dropped item changes to a unique name. The default value is false. This parameter is optional. Returns "FolderName/FolderName".
A string that specifies the path to the folder in the form "FolderName" or To move an item to the top level, specify an empty string ("") for
A Boolean value: true if the item moves successfully; false otherwise.
Method; moves the currently selected or specified library item to a specified folder. If the folderPath parameter is empty, the items move to the top level.
The following example moves the item Symbol_1 to the library folder new and replaces the item in that folder with the same name:
fl.getDocumentDOM().library.moveToFolder("new", "Symbol_1", true);
Usage library.newFolder( [folderPath] ) Parameters folderPath
A string that specifies the name of the folder to be created. If it is specified as a path, and the path doesnt exist, the path is created. This parameter is optional.
A Boolean value: true if folder is created successfully; false otherwise.
Method; creates a new folder with the specified name, or a default name ("untitled folder #") if no folderName parameter is provided, in the currently selected folder.
The following example creates two new library folders; the second folder is a subfolder of the first folder:

Property; a string that specifies the orientation of the text field. Acceptable values are "horizontal", "vertical left to right", and "vertical right to left". This property works only with static text; it generates a warning if used with other text types.
The following example sets the orientation property to "vertical right to left":
fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0].orientation = "vertical right to left";

text.renderAsHTML

Usage text.renderAsHTML Description
Property; a Boolean value. If the value is true, Flash draws the text as HTML and interprets embedded HTML tags. This property works only with dynamic or input text; it generates a warning if used with other text types.
The following example sets the renderAsHTML property to true:
fl.getDocumentDOM().selection[0].renderAsHTML = true;
Usage text.scrollable Description
Property; a Boolean value. If the value is true, the text can be scrolled. This property works only with dynamic or input text; it generates a warning if used with static text.
The following example sets the scrollable property to false:
fl.getDocumentDOM().selection[0].scrollable = false;
Usage text.selectable Description
Property; a Boolean value. If the value is true, the text can be selected. Input text is always selectable. It generates a warning when set to false and used with input text.
The following example sets the selectable property to true:
fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0].selectable = true;
Usage text.selectionEnd Description
Property; a zero-based integer that specifies the end of a text subselection. For more information, see text.selectionStart.
Usage text.selectionStart Description
Property; a zero-based integer that specifies the beginning of a text subselection. You can use this property with text.selectionEnd to select a range of characters. Characters up to, but not including, text.selectionEnd are selected.
If there is an insertion point or no selection, text.selectionEnd is equal to

timeline.copyFrames()

timeline.createMotionTween()

timeline.cutFrames()

timeline.deleteLayer() timeline.expandFolder() timeline.findLayerIndex()
timeline.getFrameProperty()
Description Retrieves the specified propertys value for the selected frames. Retrieves the specified propertys value for the selected layers. Retrieves the currently selected frames in an array. Retrieves the zero-based index values of the currently selected layers. Inserts a blank keyframe at the specified frame index; if the index is not specified, inserts the blank keyframe by using the playhead/selection. Inserts the specified number of frames at the given frame number. Inserts a keyframe at the specified frame. Pastes the range of frames from the Clipboard into the specified frames. Deletes the frame. Moves the first specified layer before or after the second specified layer. Reverses a range of frames. Selects all the frames in the current Timeline. Sets the property of the Frame object for the selected frames. Sets the specified property on all the selected layers to a specified value. Selects a range of frames in the current layer or sets the selected frames to the selection array passed into this method. Sets the layer to be selected; also makes the specified layer the current layer. Shows the layer masking during authoring by locking the mask and masked layers.
timeline.getLayerProperty()
timeline.getSelectedFrames() timeline.getSelectedLayers()
timeline.insertBlankKeyframe()

timeline.insertFrames()

timeline.insertKeyframe() timeline.pasteFrames()
timeline.removeFrames() timeline.reorderLayer()
timeline.reverseFrames() timeline.selectAllFrames() timeline.setFrameProperty()
timeline.setLayerProperty()
timeline.setSelectedFrames()
timeline.setSelectedLayers()
timeline.showLayerMasking()
Property summary for the Timeline object The following methods are available for the Timeline object.

timeline.currentFrame

Description A zero-based index for the frame at the current playhead location. A zero-based index for the currently active layer.

timeline.currentLayer

timeline.frameCount
Description Read-only; an integer that represents the number of frames in this Timelines longest layer. Read-only; an integer that represents the number of layers in the specified Timeline. Read-only; an array of layer objects. A string that represents the name of the current Timeline.

timeline.layerCount

timeline.layers timeline.name
Usage timeline.addMotionGuide() Parameters
An integer that represents the zero-based index of the newly added guide layer. If the current layer type is not of type Normal, Flash returns -1.
Method; adds a motion guide layer above the current layer and attaches the current layer to the newly added guide layer, converting the current layer to a layer of type Guided. This method functions only on a layer of type Normal. It has no effect on a layer whose type is Folder, Mask, Masked, Guide, or Guided.

The following example specifies that the text Property inspector should be used when the tool is activated.
fl.tools.activeTool.setPI( "text" );
Usage toolObj.setToolName( name ) Parameters name Returns
A string that specifies the name of the tool.
Method; assigns a name to the tool for the configuration of the Tools panel. The name is used only by the XML layout file that Flash reads to construct the Tools panel. The name does not show up in the Flash user interface.
The following example assigns the name arrow1 to the tool named theTool.
theTool.setToolName("arrow1");
Usage toolObj.setToolTip( toolTip ) Parameters toolTip Returns
A string that specifies the tooltip to use for the tool.
Method; sets the tooltip that appears when the mouse is held over the tool icon.
The following example specifies that the tooltip for the tool should be Arrow Style 1 Tool.
fl.tools.activeTool.setToolTip("Arrow Style 1 Tool");
Usage toolObj.showPIControl( control, bShow ) Parameters control A string that specifies the name of the control to show or hide. Valid values depend on the Property Inspector invoked by this tool (see toolObj.setPI()).
type color direction alignRight position rotation selectable font bold alignLeft alignJustify autoKern format html pointsize italic alignCenter spacing small lineType border

deviceFonts link

varEdit maxChars

options target

The movie Property inspector has the following controls:
size framerate publish player background profile
bShow A Boolean value that determines whether to show or hide the specified control (true shows the control; false hides the control). Returns
Method; shows or hides a control in the Property inspector.
The following command in an extensible tools JavaScript file will set Flash to not show the fill options in the Property inspector for that tool:
fl.tools.activeTool.showPIControl( "fill", false );
toolObj.showTransformHandles()
Usage toolObj.showTransformHandles( bShow ) Parameters bShow A Boolean value that determines whether to show or hide the free transform handles for the current tool (true shows the handles; false hides them). Returns

 

Tags

Alimentos KDC-MPV6022 Binatone D33 Review PSR 1440 Polaroid 600 SRU160 Voyager 510 1200dtwn FC8433 RP-29CC90 Risk 2003 Uk Tuner S810 VPL-PX15 Casio 2872 X1130P Rancher EPA Master USB 173P Plus RT-1600 XD250U-ST GP1 250 CMP-10BT HVL-hirl Voicemail Racing DSC-P93 1000 B FAX2900 Rotary Iron MBR3400 HD14542B GS605 Dt 838 DV-270-S Yzea 523 LE32A559p4F Asus M2N PE316CA WFA1447F Singer 270 42LB2R 615UA M-audio 49E Aspire-7720 FA422 AW2127S DVD-FP580 Mount Kenox S760 MS-197H ZR750-H WL-130 LRM-519 L1970HQ-BF ZKT621LX 50D Padkontrol Z5228 Sibelius SHU 5300 CDX-CA700X 29FS2RLX RLT5031AH Dvdr3512V Cooker Dryer ECB-8610 Leonardo 250 CFX12 Mkii GV-1120 ZW414 RM200B MX6441 SPP-HC700 PP46D AS280 HC280ML CDR870 Impressa F9 50 R RX-V492 FE-170 KS-FX8R HT-AF5 H-46001803 EN YO-180 CD1502B 51 DD-20-DD-20S UD-stomp D-M30 Showtime-quickstart MCX 1900 Wl-552 KM020 DB455MC Inspiron 510M Wfmc4300UC-II TM-U950 GTO936 Zoom HD16

 

manuel d'instructions, Guide de l'utilisateur | Manual de instrucciones, Instrucciones de uso | Bedienungsanleitung, Bedienungsanleitung | Manual de Instruções, guia do usuário | инструкция | návod na použitie, Užívateľská príručka, návod k použití | bruksanvisningen | instrukcja, podręcznik użytkownika | kullanım kılavuzu, Kullanım | kézikönyv, használati útmutató | manuale di istruzioni, istruzioni d'uso | handleiding, gebruikershandleiding

 

Sitemap

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101