### fl.installedPlayers Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/JSAPI.md Gets the list of installed players. This property returns an array of installed player names. ```APIDOC ## Property: fl.installedPlayers ### Description Gets the list of installed players. ### Property `fl.installedPlayers` ### Type Array of Strings ### Access Read-only ``` -------------------------------- ### keyUp() Example with fl.trace Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Top-Level_Functions_and_Methods/keyUp.md Example that displays a message in the Output panel when the extensible tool is active and a key is released. ```javascript function keyUp() { fl.trace("Key is released"); } ``` -------------------------------- ### Display Configuration directory with fl.configDirectory Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/flash_object_(fl)/fl12.md Read-only property returning the full path to the local user's Configuration directory in a platform-specific format. Use fl.configURI for a file:/// URI. The example traces the path to the Output panel. ```javascript fl.trace("My local configuration directory is " + fl.configDirectory); ``` -------------------------------- ### keyDown() example using fl.tools.getKeyDown() Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Top-Level_Functions_and_Methods/keyDown.md Example implementation of keyDown() that traces the pressed key using fl.tools.getKeyDown(). Called when the extensible tool is active and the user presses a key. ```javascript function keyDown() { fl.trace("key " + fl.tools.getKeyDown() + " was pressed"); } ``` -------------------------------- ### ActionScript 3.0 callback setup for swfPanel.call() Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/swfPanel_object/swfPanel.md ActionScript 3.0 code for a Window SWF panel that exposes a callback via ExternalInterface.addCallback() and uses MMExecute() to run a JSFL file. The callback function callMeFromJavascript sets the text of a dynamic text box named myTextField. The JSFL file is referenced as WindowSWF/fileOp.jsfl. ```javascript // Here's the callback function to be called from JSAPI function callMeFromJavascript(arg:String):void { try { var name:String = String(arg); myTextField.text = name; } catch (e:Error) { } } // Expose the callback function as "callMySWF" ExternalInterface.addCallback("callMySWF", callMeFromJavascript); // run the JSAPI to wire up the callback MMExecute("fl.runScript( fl.configURI + \"WindowSWF/fileOp.jsfl\" );"); MMExecute("fl.trace(\"AS3 File Status Panel Initialized\");"); ``` -------------------------------- ### Create folder and subfolder under configuration folder Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/FLfile_object/FLfile1.md Creates a folder and a subfolder under the configuration folder (fl.configURI). Returns true if successful, false if the folder already exists. ```javascript fl.trace(FLfile.createFolder(fl.configURI+"folder01/subfolder01")); ``` -------------------------------- ### Get sound envelope limits for a frame Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Frame_object/frame9.md Retrieves the start and end limits of a custom sound envelope applied to a frame's sound. The returned structure contains start and end fields, which are traced to the Output panel in the example. ```javascript var limits = fl.getDocumentDOM().getTimeline().layers[0].frames[0].getSoundEnvelopeLimits(); fl.trace(limits.start); fl.trace(limits.end); ``` -------------------------------- ### Get frame sequence duration with frame.duration Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Frame_object/frame4.md Read-only property returning the number of frames in a frame sequence. The example stores the duration of the frame sequence starting at the first frame in the top layer in the frameSpan variable. ```javascript var frameSpan = fl.getDocumentDOM().getTimeline().layers[0].frames[0].duration; ``` -------------------------------- ### configureTool() with setOptionsFile Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Top-Level_Functions_and_Methods/configureTool.md First implementation of configureTool() called when Flash loads the extensible tool. Sets tool name, icon, menu string, tool tip, and an options file (mtTool.xml). ```javascript 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" ); } ``` -------------------------------- ### Get fill color for character range Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Text_object/text11.md Retrieves the 'fillColor' attribute for characters from index 2 up to but not including index 8. The result is not traced in this example. ```javascript fl.getDocumentDOM().selection[0].getTextAttr("fillColor", 2, 8); ``` -------------------------------- ### compiledClipInstance.shortcut Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/index.md A string that is equivalent to the Shortcut field in the Accessibility panel. ```APIDOC ## Property: compiledClipInstance.shortcut ### Description A string that is equivalent to the Shortcut field in the Accessibility panel. ### Type String ### Access Read/Write ``` -------------------------------- ### configureTool() Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Top-Level_Functions_and_Methods/configureTool.md Function called when Flash opens and the extensible tool is loaded into the Tools panel. Use this function to set any information Flash needs to know about the tool. ```APIDOC ## configureTool() ### Description Function; called when Flash opens and the extensible tool is loaded into the Tools panel. Use this function to set any information Flash needs to know about the tool. ### Availability Flash MX 2004. ### Usage function configureTool() { // statements } ### Parameters None. ### Returns Nothing. ### Example ```javascript 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" ); } ``` ```javascript function configureTool() { theTool = fl.tools.activeTool; theTool.setToolName("ellipse"); theTool.setIcon("Ellipse.png"); theTool.setMenuString("Ellipse"); theTool.setToolTip("Ellipse"); theTool.showTransformHandles( true ); } ``` ``` -------------------------------- ### Get edge and half edge for a shape Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/HalfEdge_object/halfEdge.md Retrieves the Edge object for a HalfEdge object. The example gets the first selected shape, obtains its first half edge, then calls getEdge() on it. ```javascript var shape = fl.getDocumentDOM().selection[0]; var hEdge = shape.edges[0].getHalfEdge(0); var edge = hEdge.getEdge(); ``` -------------------------------- ### fl.createDocument() Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/index.md Opens a new document and selects it. ```APIDOC ## fl.createDocument() ### Description Opens a new document and selects it. ### Method N/A (JavaScript method) ### Endpoint N/A (JavaScript method) ### Parameters No parameters documented. ### Request Example No request body. ### Response No response documented. ``` -------------------------------- ### Insert four frames in all layers starting from first frame Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Timeline_object/timeli28.md Inserts four frames in all layers, starting from the first frame (index 0), by passing true for bAllLayers and 0 for frameNumIndex. ```javascript fl.getDocumentDOM().getTimeline().insertFrames(4, true, 0); ``` -------------------------------- ### Get and set compiledClipInstance.description Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/CompiledClipInstance_object/compiledClipInstan15.md Illustrates reading and writing the description property of the first selected compiled clip instance. The description corresponds to the Description field in the Accessibility panel and is read by screen readers. Available in Flash MX 2004. ```javascript // Get the description of the current selection. var theDescription = fl.getDocumentDOM().selection[0].description; // Set the description of the current selection. fl.getDocumentDOM().selection[0].description = "This is compiled clip number 1"; ``` -------------------------------- ### configureTool() with showTransformHandles Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Top-Level_Functions_and_Methods/configureTool.md Second implementation of configureTool() called when Flash loads the extensible tool. Sets tool name, icon, menu string, tool tip, and enables transform handles via showTransformHandles(true). ```javascript function configureTool() { theTool = fl.tools.activeTool; theTool.setToolName("ellipse"); theTool.setIcon("Ellipse.png"); theTool.setMenuString("Ellipse"); theTool.setToolTip("Ellipse"); theTool.showTransformHandles( true ); } ``` -------------------------------- ### actionsPanel.setSelection() example Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/actionsPanel_object/actionsPane7.md Selects characters in the Actions panel starting at index 3 for 4 characters, then replaces them with '// Last updated: 2007'. The example includes a comment showing the first line to type in the Actions panel. ```javascript The following example replaces the characters "2006" in the Actions panel with the specified text. // Type the following as the first line in the Actions panel // 2006 - Addresses user request 40196 // Type the following in the JSFL file fl.actionsPanel.setSelection(3,4); fl.actionsPanel.replaceSelectedText("// Last updated: 2007"); ``` -------------------------------- ### Get filters at frame using layer.getFiltersAtFrame() Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Layer_object/layer15.md Retrieves an array of filters applied to a specified frame. The frameIndex parameter is an integer specifying the absolute frame index. This example gets filters at the first frame of the first layer. ```javascript var myFilters = an.getDocumentDOM().getTimeline().layers[0].getFiltersAtFrame(0); ``` -------------------------------- ### FLfile.createFolder() Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/FLfile_object/FLfile_summary.md Creates one or more folders. ```APIDOC ## FLfile.createFolder() ### Description Creates one or more folders. ### Method FLfile.createFolder() ### Parameters No parameters documented. ### Response No response documented. ``` -------------------------------- ### textAttrs.target Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/TextAttrs_object/textAtt16.md Gets or sets the target property of a text field. This property works only with static text. ```APIDOC ## textAttrs.target ### Description Property; a string that represents the target property of the text field. This property works only with static text. ### Usage `textAttrs.target` ### Availability Flash MX 2004. ### Example ```javascript fl.outputPanel.trace(fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0].getTextAttr("target")); ``` ``` -------------------------------- ### Browse for folder and list its contents Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/flash_object_(fl)/fl4.md Displays a Browse for Folder dialog box with the given description and returns the selected folder as a file:/// URI. If the user cancels, it returns null. The example then lists the folder contents using FLfile.listFolder(). ```javascript var folderURI = fl.browseForFolderURL("Select a folder."); var folderContents = FLfile.listFolder(folderURI); ``` -------------------------------- ### Get text from character index 5 Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Document_object/docume87.md Returns the string starting at character index 5 and ending at the end of the field. ```javascript fl.getDocumentDOM().getTextString(5); ``` -------------------------------- ### fl.configDirectory Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/index.md Read-only property that returns a string specifying the full path for the local user's Configuration folder as a platform-specific path. ```APIDOC ## Property: fl.configDirectory ### Description Read-only; a string that specifies the full path for the local user's Configuration folder as a platform-specific path. ### Access Read-only ### Returns - **string** - The full path to the Configuration folder. ``` -------------------------------- ### fontItem.size Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/fontItem_object/fontIte8.md Gets or sets the size of a Font item in points. This property is available in Flash CS4 Professional and later. ```APIDOC ## fontItem.size ### Description Gets or sets the size of a Font item in points. ### Availability Flash CS4 Professional. ### Usage fontItem.size ### Type Integer ### Example Assuming that the first item in the Library is a Font item, the following code displays the item’s point size in the Output panel and then sets it to 24. ```javascript var theItem = fl.getDocumentDOM().library.items[0]; fl.outputPanel.clear(); fl.trace("font size: "+ theItem.size); theItem.size=24; fl.trace("font size: "+ theItem.size); ``` ``` -------------------------------- ### Create folder with FLfile.createFolder Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/FLfile_object/FLfile_summary.md Creates a folder on the local file system using a file URI. The example creates the config folder under Program Files/MyApp on the C drive. ```javascript FLfile.createFolder("file:///C|/Program Files/MyApp/config"); ``` -------------------------------- ### Get selected text length Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Text_object/text13.md Returns the number of characters in the selected text object. The example assigns the length to a variable. ```javascript var textLength = fl.getDocumentDOM().selection[0].length; ``` -------------------------------- ### Trace installedPlayers array properties Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/flash_object_(fl)/fl36.md Read-only property returning an array of generic objects for installed Flash Players in the document PI. Each object includes name, version, minASVersion, maxASVersion, stageWidth, and stageHeight. The example traces all properties of each object to the output window. ```javascript var arr = fl.installedPlayers; for (var i in arr) fl.trace("name: " + arr[i].name + " version: " + arr[i].version + " minASVersion: " + arr[i].minASVersion + " maxASVersion: " + arr[i].maxASVersion + " stageWidth: " + arr[i].stageWidth + " stageHeight: " + arr[i].stageHeight + " "); ``` -------------------------------- ### text.selectionStart Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/JSAPI.md Gets or sets the selection start index of the text object. This property is part of the Text object API. ```APIDOC ## text.selectionStart ### Description Gets or sets the selection start index of the text object. ### Property selectionStart ### Endpoint text.selectionStart ``` -------------------------------- ### Create a new button item in a folder with library.addNewItem() Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/library_object/library1.md Creates a new button item named 'start' in a new folder 'folderTwo' using the library.addNewItem() method. The type parameter accepts only 'video', 'movie clip', 'button', 'graphic', 'bitmap', 'screen', or 'folder'. Returns true if successful, false otherwise. ```javascript fl.getDocumentDOM().library.addNewItem("button", "folderTwo/start"); ``` -------------------------------- ### List files, directories, and both in a folder Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/FLfile_object/FLfile9.md Returns three arrays: files, directories, and both from the C:\temp folder. Uses the optional filesOrDirectories parameter with values "files" and "directories". Traces the results to the Output panel. ```javascript var fileURI = "file:///C|/temp/" ; var folderURI = "file:///C|/temp" ; var fileList1 = FLfile.listFolder(fileURI, "files"); // files var fileList2 = FLfile.listFolder(folderURI, "directories"); //folders var fileList3 = FLfile.listFolder(folderURI); //files and folders fl.trace("Files: " + fileList1); fl.trace(""); fl.trace("Folders: " + fileList2); fl.trace(""); fl.trace("Files and folders: " + fileList3); ``` -------------------------------- ### Get and trace the most recently pressed key with tools.getKeyDown() Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Tools_object/tools4.md Use this method to retrieve the integer value of the most recently pressed key. The example stores the value in a variable and traces it to the Output panel. Available in Flash MX 2004 and later. ```javascript var theKey = fl.tools.getKeyDown(); fl.trace(theKey); ``` -------------------------------- ### configureTool() Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/JSAPI.md Configures a tool. This is a top-level function that can be called directly by users. ```APIDOC ## configureTool() ### Description Configures a tool. ### Method Function ### Endpoint configureTool() ``` -------------------------------- ### Get layer parent at frame using getRigParentAtFrame() Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Layer_Parenting_Object/layerParenting1.md Retrieves the layer parent of the specified frame. The example gets the parent from the first frame (index 0) of the ninth layer (index 8) in the current timeline. Available in Adobe Animate 2020. ```javascript var myparent = an. getDocumentDOM(). getTimeline(). layers[8]. getRigParentAtFrame (0); ``` -------------------------------- ### Show tool position in Tools panel with toolObj.position Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/ToolObj_object/toolObj3.md Read-only integer property specifying the tool's position in the Tools panel, used only for extensible tools. The example commands in the mouseDown() method trace the active tool's position to the Output panel. ```javascript myToolPos = fl.tools.activeTool.position; fl.trace(myToolPos); ``` -------------------------------- ### Create config file if missing with FLfile.exists() Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/FLfile_object/FLfile2.md Checks if a required configuration file exists in the MyApplication folder. If the file doesn't exist, it is created using FLfile.write(). ```javascript var configFile = "file:///C|/MyApplication/config.ini"; if (!FLfile.exists(configFile)) { FLfile.write(configFile,""); } ``` -------------------------------- ### Get textAttrs.target property Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/TextAttrs_object/textAtt16.md Retrieves the target property of a static text field and displays it in the Output panel. Works only with static text. ```javascript fl.outputPanel.trace(fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0].getTe xtAttr("target")); ``` -------------------------------- ### Get tagged swatch at index 0 Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Document_object/docu6061.md Returns the tagged swatch at the specified index. The example retrieves the swatch at index 0 from the default palette. ```javascript var document = fl.getDocumentDOM(); var swatch = document.getTaggedSwatchAtIndex(0); ``` -------------------------------- ### Import publish profile and display index Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Document_object/docume94.md Imports a publish profile from an XML file specified by a file:/// URI and displays the returned profile index in an alert dialog. Returns -1 if the profile cannot be imported. Available in Flash MX 2004. ```javascript alert(fl.getDocumentDOM().importPublishProfile('file:///C\|/Documents and Settings/janeUser/Desktop/profile.xml')); ``` -------------------------------- ### Create folder and alert result Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/FLfile_object/FLfile1.md Attempts to create a folder called tempFolder at the root level on the C drive and displays an alert box indicating whether the operation was successful. ```javascript var folderURI = "file:///c|/tempFolder"; if (FLfile.createFolder(folderURI)) { alert("Created " + folderURI); } else { alert(folderURI + " already exists"); } ``` -------------------------------- ### timeline.clearFrames() Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Timeline_object/timelin2.md Deletes all contents from a frame or range of frames on the current layer. The range is defined by start and end indices, with the end index being exclusive. ```APIDOC ## timeline.clearFrames() ### Description Deletes all the contents from a frame or range of frames on the current layer. ### Method clearFrames ### Signature `timeline.clearFrames([startFrameIndex [, endFrameIndex]])` ### Parameters - **startFrameIndex** (Number) - Optional - A zero-based index that defines the beginning of the range of frames to clear. If omitted, uses the current selection. - **endFrameIndex** (Number) - Optional - A zero-based index that defines the end of the range of frames to clear. The range goes up to, but does not include, this index. If only startFrameIndex is specified, defaults to startFrameIndex. ### Returns Nothing. ### Example ```javascript fl.getDocumentDOM().getTimeline().clearFrames(5, 10); ``` ```javascript fl.getDocumentDOM().getTimeline().clearFrames(14); ``` ``` -------------------------------- ### fl.configURI Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/JSAPI.md Gets the configuration URI. This property returns the URI of the configuration file. ```APIDOC ## Property: fl.configURI ### Description Gets the configuration URI. ### Property `fl.configURI` ### Type String ### Access Read-only ``` -------------------------------- ### frame.motionTweenRotateTimes Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Frame_object/frame18.md Property that specifies the number of times a tweened element rotates between the starting keyframe and the next keyframe. Available in Flash MX 2004. ```APIDOC ## frame.motionTweenRotateTimes ### Description Property; an integer that specifies the number of times the tweened element rotates between the starting keyframe and the next keyframe. ### Availability Flash MX 2004. ### Usage *frame.motionTweenRotateTimes* ### Example ```javascript fl.getDocumentDOM().getTimeline().layers[0].frames[0].motionTweenRotate = "counter-clockwise"; fl.getDocumentDOM().getTimeline().layers[0].frames[0].motionTweenRotateTimes = 3; ``` ``` -------------------------------- ### Display publish profile names with document.publishProfiles Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Document_object/docum220.md Read-only property returning an array of publish profile names for the document. The example iterates the array and traces each name to the Output panel. Available in Flash MX 2004. ```javascript var myPubProfiles = fl.getDocumentDOM().publishProfiles; for (var i=0; i < myPubProfiles.length; i++){ fl.trace(myPubProfiles[i]); } ``` -------------------------------- ### Move selected items and a named preset to a folder Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/presetPanel_object/presetPan10.md Moves the currently selected items to the 'Custom Presets/Bouncing' folder, then moves the 'Custom Presets/Fast Bounce' preset to the same folder. Returns true on success, false otherwise. Cannot move items to or from the Default Presets folder. ```javascript fl.presetPanel.moveToFolder("Custom Presets/Bouncing"); fl.presetPanel.moveToFolder("Custom Presets/Bouncing" , "Custom Presets/Fast Bounce"); ``` -------------------------------- ### compiledClipInstance.description Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/CompiledClipInstance_object/compiledClipInstan15.md Gets or sets the description of a compiled clip instance, which is read by screen readers. This property is available in Flash MX 2004 and later. ```APIDOC ## compiledClipInstance.description ### Description Gets or sets the description of a compiled clip instance. The description is a string that is equivalent to the Description field in the Accessibility panel and is read by screen readers. ### Availability Flash MX 2004. ### Usage compiledClipInstance.description ### Example ```javascript // Get the description of the current selection. var theDescription = fl.getDocumentDOM().selection[0].description; // Set the description of the current selection. fl.getDocumentDOM().selection[0].description = "This is compiled clip number 1"; ``` ``` -------------------------------- ### Trace library item name Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Item_object/item13.md Shows the name of the first library item in the Output panel using the item.name property. ```javascript fl.trace(fl.getDocumentDOM().library.items[0].name); ``` -------------------------------- ### Display timeline guidelines as XML string Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Timeline_object/timeli23.md Use this snippet to retrieve the current horizontal and vertical guide line positions for a timeline as an XML string. The example assumes guide lines exist on the first timeline and traces the result to the Output panel. Requires Flash CS4 Professional. ```javascript var currentTimeline = fl.getDocumentDOM().timelines[0]; fl.trace(currentTimeline.getGuidelines()); ``` -------------------------------- ### Export selected instance to library as bitmap Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Document_object/docume62.md Exports the selected instance on frame 1 to the library and names the new bitmap 'myTestBitmap'. Available in Flash CS6. Returns nothing. ```javascript fl.getDocumentDOM().exportInstanceToLibrary(1, "myTestBitmap"); ``` -------------------------------- ### Set sound envelope limits with frame.setSoundEnvelopeLimits() Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Frame_object/frame28.md Sets the sound envelope limits for a frame that contains a sound file. The limits parameter must be a structure with start and end fields. The example assigns start and end values to a limits object and calls the method on the first frame of the first layer. ```javascript var limits; limits.start = 2000; limits.end = 15000; fl.getDocumentDOM().getTimeline().layers[0].frames[0].setSoundEnvelopeLimits(limits); ``` -------------------------------- ### Get rig matrix from first frame of ninth layer Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Layer_Parenting_Object/layerParenting3.md Retrieves the rig matrix for a specified frame using layer.getRigMatrixAtFrame(frameIndex). The example gets the matrix from the first frame (index 0) of the ninth layer (index 8) in the current timeline. Available in Adobe Animate 2020. ```javascript var matrix = an. getDocumentDOM(). getTimeline(). layers[8]. getRigMatrixAtFrame (0); ``` -------------------------------- ### Get current mouse location with tools.penLoc Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Tools_object/tools7.md Read-only property returning a point with x and y properties for the current mouse pointer location. The example assigns it to a variable. ```javascript var tempPt = fl.tools.penLoc; ``` -------------------------------- ### fl.openScript(fileURI) Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/flash_object_(fl)/fl46.md Opens an existing file or creates a new script (JSFL, AS, ASC) or other file (XML, TXT) in Flash. Takes a file URI as a string and returns nothing. ```APIDOC ## [METHOD] fl.openScript(fileURI) ### Description Opens an existing file or creates a new script (JSFL, AS, ASC) or other file (XML, TXT) in Flash. ### Method fl.openScript ### Parameters #### Parameters - **fileURI** (string) - Required - A string, expressed as a file:/// URI, that specifies the path of the JSFL, AS, ASC, XML, TXT, or other file that should be loaded into Flash. ### Returns Nothing. ### Example ```javascript fl.openScript("file:///c|/temp/my_test.jsfl"); ``` ``` -------------------------------- ### Get tagged swatches palette list Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Document_object/docu6063.md Returns an array of tagged swatches palette names. Requires Animate 2020. The example assigns the result to a variable 'arr'. ```javascript var document = fl.getDocumentDOM(); var arr = document.getTaggedSwatchesPaletteList(); ``` -------------------------------- ### configureTool() Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/index.md Configures the tool. This function is available in scripts that create extensible tools. ```APIDOC ## configureTool() ### Description Configures the tool. This function is available in scripts that create extensible tools. ### Method configureTool() ### Parameters None documented. ### Returns No return value documented. ``` -------------------------------- ### fl.libraryPath Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/flash_object_(fl)/fl39.md Gets or sets the global ActionScript 3.0 Library path, a semicolon-delimited string of SWC file locations. This property is available in Flash CS4 Professional. ```APIDOC ## fl.libraryPath ### Description Gets or sets the global ActionScript 3.0 Library path, which specifies the location of SWC files or folders containing SWC files. Items are delimited by semi-colons. ### Property `fl.libraryPath` ### Availability Flash CS4 Professional. ### Usage `fl.libraryPath` ### Example ```javascript fl.trace(fl.libraryPath); fl.libraryPath = "/SWC;" + fl.libraryPath; fl.trace(fl.libraryPath); ``` ### See Also - [fl.externalLibraryPath](../flash_object_(fl)/fl23.md) - [fl.flexSDKPath](../flash_object_(fl)/fl29.md) - [fl.sourcePath](../flash_object_(fl)/fl72.md) - [document.libraryPath](../Document_object/docume99.md) ``` -------------------------------- ### JSFL file to call Sample.computeSum Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/C-Level_Extensibility/Integrating_C_functions.md JSFL file that calls the computeSum function from the Sample DLL, passing two numbers and tracing the result to the Output panel. Store this file in the Configuration/Commands directory and run it via Commands > Sample in Animate. ```JavaScript // JSFL file to run C function defined above. var a = 5; var b = 10; var sum = Sample.computeSum(a, b); fl.trace("The sum of " + a + " and " + b + " is " + sum ); ``` -------------------------------- ### textAttrs.face Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/TextAttrs_object/textAttr6.md Property that represents the name of the font, such as "Arial". This property is used to get or set the font face of text attributes in the Animate SDK. ```APIDOC ## textAttrs.face ### Description Property; a string that represents the name of the font, such as "Arial". ### Availability Flash MX 2004. ### Usage textAttrs.face ### Example The following example sets the font of the selected text field from the character at index 2 up to, but not including, the character at index 8 to Arial: ```javascript fl.getDocumentDOM().selection[0].setTextAttr("face", "Arial", 2, 8); ``` ``` -------------------------------- ### MM_InitWrapper declaration with platform conditionals Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/C-Level_Extensibility/Integrating_C_functions.md Declares the external entry point with Windows-specific dllexport and fallback extern for other platforms. ```C // Declare the external entry point and linkage #ifdef _WIN32 # ifndef _MAC // Windows __declspec ( dllexport ) void MM_InitWrapper( MM_Environment *env, unsigned int envSize ); # endif #else extern void MM_InitWrapper( MM_Environment *env, unsigned int envSize ); #endif ``` -------------------------------- ### document.setInstanceBrightness() Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/JSAPI.md This method sets the brightness for an instance. ```APIDOC ## document.setInstanceBrightness() ### Description This method sets the brightness for an instance. ### Method N/A ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` -------------------------------- ### Get tagged swatch by name Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Document_object/docu6062.md Returns the tagged swatch with the given name. Available in Animate 2020. The example retrieves the tagged swatch named "swatch1". ```javascript var document = fl.getDocumentDOM(); var swatch = document.getTaggedSwatchByName("swatch1"); ``` -------------------------------- ### text.getTextAttr() Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Text_object/text11.md Retrieves the value of a specified text attribute for a text range. The range can be the entire text, a single character, or a specified range defined by start and end indices. ```APIDOC ## text.getTextAttr() ### Description Retrieves the value of the attribute specified by the `attrName` parameter for the text identified by the optional `startIndex` and `endIndex` parameters. If the attribute is not consistent for the specified range, Flash returns undefined. ### Method Method (no HTTP method) ### Endpoint `text.getTextAttr(attrName [, startIndex [, endIndex]])` ### Parameters #### Parameters - **attrName** (string) - Required - The name of the TextAttrs object property to be returned. For a list of possible values, see the Property summary for the TextAttrs object. - **startIndex** (integer) - Optional - The index of the first character. If omitted, the entire text range is used. If specified alone, the range is a single character at that position. - **endIndex** (integer) - Optional - The end of the range of text, which starts with `startIndex` and goes up to, but does not include, `endIndex`. If omitted, the range extends to the end of the text. ### Returns The value of the attribute specified in the `attrName` parameter. ### Example ```javascript var TheTextSize = fl.getDocumentDOM().selection[0].getTextAttr("size"); fl.trace(TheTextSize); ``` ```javascript var TheFill = fl.getDocumentDOM().selection[0].getTextAttr("fillColor"); fl.trace(TheFill); ``` ```javascript var Char3 = fl.getDocumentDOM().selection[0].getTextAttr("size", 2); fl.trace(Char3); ``` ```javascript fl.getDocumentDOM().selection[0].getTextAttr("fillColor", 2, 8); ``` ``` -------------------------------- ### compiledClipInstance.accName Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/index.md A string property that is equivalent to the Name field in the Accessibility panel. ```APIDOC ## Property: compiledClipInstance.accName ### Description A string that is equivalent to the Name field in the Accessibility panel. ### Type String ### Availability Flash MX 2004. ### Applies to CompiledClipInstance object ``` -------------------------------- ### Create folder on Macintosh with FLfile.createFolder Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/FLfile_object/FLfile_summary.md Creates a folder on a Macintosh file system using a file URI. The example creates the config folder under /MyApp. ```javascript FLfile.createFolder("file:///Macintosh/MyApp/config"); ``` -------------------------------- ### Get TextureAtlasExporter app name Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/TextureAtlasExporter_object/TextureAtlasExporter3.md Read-only property returning the name of the application generating the TextureAtlas, e.g., "Adobe Animate". Available in Animate 2020. ```javascript var exporter = new TextureAtlasExporter; alert(exporter.app); // "Adobe Animate" ``` -------------------------------- ### FLfile.getCreationDateObj() Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/FLfile_object/FLfile_summary.md Gets the date a file or folder was created. ```APIDOC ## FLfile.getCreationDateObj() ### Description Gets the date a file or folder was created. ### Method FLfile.getCreationDateObj() ### Parameters No parameters documented. ### Response No response documented. ``` -------------------------------- ### mouseUp() function example Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Top-Level_Functions_and_Methods/mouseUp.md Defines the mouseUp() callback for an extensible tool. It is called when the tool is active and the mouse button is released on the Stage. The example traces a message to the Output panel. Available in Flash MX 2004 and later. Takes no parameters and returns nothing. ```javascript function mouseUp() { fl.trace("mouse is up"); } ``` -------------------------------- ### Expand Custom Presets folder with subfolders Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/presetPanel_object/presetPane4.md Expands the 'Custom Presets' folder and all its subfolders in the Motion Presets panel. The bExpand parameter is true, bRecurse is true, and folderPath specifies the target folder. ```javascript fl.presetPanel.expandFolder(true, true, "Custom Presets"); ``` -------------------------------- ### Get size of third character Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Text_object/text11.md Retrieves the 'size' attribute for a single character at index 2 (third character) and traces the result. Requires a text field selection. ```javascript var Char3 = fl.getDocumentDOM().selection[0].getTextAttr("size", 2); fl.trace(Char3); ``` -------------------------------- ### Get fill color of selected text field Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Text_object/text11.md Retrieves the 'fillColor' attribute for the entire selected text field and traces the result. Requires a text field selection. ```javascript var TheFill = fl.getDocumentDOM().selection[0].getTextAttr("fillColor"); fl.trace(TheFill); ``` -------------------------------- ### document.setInstanceTint() Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/JSAPI.md This method sets the tint for an instance. ```APIDOC ## document.setInstanceTint() ### Description This method sets the tint for an instance. ### Method N/A ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` -------------------------------- ### Associating PolyStar.xml with active tool using setOptionsFile() Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/ToolObj_object/toolObj6.md Example from the sample PolyStar.jsfl file. Associates the PolyStar.xml file with the currently active tool by calling setOptionsFile() on the active tool object. Typically used inside the configureTool() function. ```JavaScript theTool = fl.tools.activeTool; theTool.setOptionsFile("PolyStar.xml"); ``` -------------------------------- ### text.orientation Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Text_object/text16.md Sets or gets the orientation of a text field. Acceptable values are 'horizontal', 'vertical left to right', and 'vertical right to left'. This property works only with static text. ```APIDOC ## 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; it generates a warning if used with other text types. ### Usage `text.orientation` ### Availability Flash MX 2004. ### Example ```javascript fl.getDocumentDOM().selection[0].orientation = "vertical right to left"; ``` ``` -------------------------------- ### Get vertical pixel count with bitmapItem.vPixels Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/BitmapItem_object/bitmapIte14.md Read-only property returning the bitmap height in pixels. The example retrieves the first library item and stores its vPixels value in numHorizontalPixels. ```javascript // get the number of pixels in the vertical dimension var bmitemObj = fl.getDocumentDOM().library.items[0]; var numHorizontalPixels = bmitemObj.vPixels; ``` -------------------------------- ### fl.trace() Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/index.md Sends a text string to the Output panel. ```APIDOC ## fl.trace() ### Description Sends a text string to the Output panel. ### Method fl.trace() ``` -------------------------------- ### fl.createNewTemplateList Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/JSAPI.md Gets the list of templates for new documents. This property returns an array of available templates. ```APIDOC ## Property: fl.createNewTemplateList ### Description Gets the list of templates for new documents. ### Property `fl.createNewTemplateList` ### Type Array of Strings ### Access Read-only ``` -------------------------------- ### Get camera position at a frame using camera.getPosition() Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/Camera_object/Camera3.md Retrieves the camera's x, y, and z coordinates at a specified frame index. The method returns a Point object (e.g., {x:0,y:0}) and is available in Adobe Animate 2019. The example gets the position at frame index 3 (the 4th frame) and traces the x and y values. ```javascript var tl = an.getDocumentDOM().getTimeline(); var cameraPos = tl.camera.getPosition(3); // get the camera position at 4th frame in timeline an.trace("Camera position: x = " + cameraPos.x + ", y = " + cameraPos.y); ``` -------------------------------- ### Run script using fl.configURI Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/flash_object_(fl)/fl13.md Runs a specified script by combining the user's Configuration directory URI with a relative path. This avoids needing to know the platform-specific path. The example shows how to run a command from the Commands menu by changing "Test.Jsfl" to the desired command name. ```javascript // To run a command in your commands menu, change "Test.Jsfl" // to the command you want to run in the line below. fl.runScript( fl.configURI + "Commands/Test.jsfl" ); ``` -------------------------------- ### presetItem.isDefault Source: https://github.com/adobedocs/developers-animatesdk-docs/blob/master/presetItem_object/presetItem.md Read-only property that indicates whether a motion preset item is installed with Flash (true) or is a custom item (false). Use this to determine if the item is read-only and cannot be moved or deleted. ```APIDOC ## presetItem.isDefault ### Description Read-only property: a Boolean value that specifies whether the item is installed along with Flash (true) or is a custom item that you or someone else has created (false). If this value is true, you can consider it a "read-only" item; it can’t be moved, deleted, or have any similar operations applied to it. ### Availability Flash CS4 Professional. ### Usage presetItem.isDefault ### Example The following example displays the contents of the Motion Presets panel and indicates whether an item is installed along with Flash: ```javascript fl.outputPanel.clear(); var presetItemArray=fl.presetPanel.items; for (i=0;i