Flash MX 2004 JSFL Reference

Table of Contents

  1. BitmapInstance
  2. BitmapItem
  3. CompiledClipInstance
  4. ComponentInstance
  5. ComponentsPanel
  6. Contour
  7. Document
  8. DrawingLayer
  9. Edge
  10. Effect
  11. Element
  12. EmbeddedVideoInstance
  13. Fill
  14. Flash
  15. FolderItem
  16. FontItem
  17. Frame
  18. Functions
  19. HalfEdge
  20. Instance
  21. Item
  22. Layer
  23. Library
  24. LinkedVideoInstance
  25. Math
  26. Matrix
  27. OutputPanel
  28. Parameter
  29. Path
  30. Screen
  31. ScreenOutline
  32. ScreenType
  33. Shape
  34. SoundItem
  35. Stroke
  36. SymbolInstance
  37. SymbolItem
  38. Text
  39. TextAttrs
  40. TextRun
  41. Timeline
  42. ToolObj
  43. Tools
  44. Vertex
  45. VideoItem
  46. XMLUI

Flash MX 2004 JSFL Reference

Flash MX 2004 JSFL Reference

1. BitmapInstance

Subclass of Instance; a bitmap on the Stage

Methods

Name Args Description
getBits bitmap Gets bits from a bitmap
setBits bitmap Sets bits of a bitmap

Properties

Name Description
hPixels Width of BItmapInstance in pixels
vPixels Height of BItmapInstance in pixels

2. BitmapItem

Subclass of Item; a bitmap symbol in the Library

Properties

Name Description
allowSmoothing If true, smooths edges of bitmap with anti-aliasing
compressionType Specifies compression type for export
quality Quality for JPEG compression
useImportedJPEGQuality If true, imported JPEG's quality for export

3. CompiledClipInstance

Subclass of SymbolInstance; a compiled clip instance on the Stage

Properties

Name Description
accName Name of an object, used by screen reader
actionScript String representing the ActionScript on an instance
description Description of the object, used by screen reader
forceSimple If true, the children of the object are not accessible to screen reader
shortcut An object's runtime shortcut key
silent If true, object is not read by screen reader
tabIndex tabIndex value of an object

4. ComponentInstance

Subclass of SymbolInstance; a component instance on the Stage

Properties

Name Description
parameters Component's parameters

5. ComponentsPanel

Components panel

Methods

Name Args Description
addItemToDocument position, categoryName, componentName Adds component to the document

6. Contour

A closed path of half edges

Methods

Name Args Description
getHalfEdge Returns a halfEdge object

Properties

Name Description
interior If true, contour encloses an area
orientation Integer indicating the orientation of a contour

7. Document

The Stage

Methods

Name Args Description
addDataToDocument name, type, data Stores data with a document
addDataToSelection name, type, data Stores data with selected objects
addItem position, item Adds an Item from the Library to the Stage
addNewLine startPoint, endPoint Draws a line on the Stage
addNewOval boundingRectangle [, bSuppressFill] [, bSuppressStroke] Draws an oval on the Stage
addNewPublishProfile [profileName] Adds a new publish profile
addNewRectangle boundingRectangle, roundness [, bSupressFill] [, bSuppressStroke] Draws a new rectangle on the Stage
addNewScene [name] Adds a new scene
addNewText boundingRectangle Inserts a new empty text field
align alignmode [, bUseDocumentBounds] Aligns the selection
allowScreens Checks if the Screen Outline is available
arrange arrangeMode Arranges the selection
breakApart Breaks apart the current selection
canEditSymbol If true, the editSymbol() method can be used
canRevert Indicates if a document can be reverted
canTestMovie Indicates if movie can be tested
canTestScene Indicates if current scene can be tested
clipCopy Copies the selection selection to the Clipboard
clipCut Cuts the selection to the Clipboard
clipPaste [bInPlace] Pastes the Clipboard into the document
close [bPromptToSaveChanges] Closes the current document
convertLinesToFills Converts lines to fills on selected objects
convertToSymbol type, name, registrationPoint Converts selected items to a new symbol
deletePublishProfile Deletes the current publish profile
deleteScene Deletes the current scene
deleteSelection Deletes the selection from the Stage
distribute distributemode [, bUseDocumentBounds] Distributes the selection
distributeToLayers Distributes the current selection to layers
documentHasData name If true, there is persistent data
duplicatePublishProfile [profileName] Duplicates the current profile
duplicateScene Duplicates the current scene
duplicateSelection Duplicates the selection
editScene index Sets the specified scene to be the current one
enterEditMode [editMode] Enters an edit mode for a symbol or group
exitEditMode Exits an edit mode
exportPublishProfile fileURI Exports the current publish profile to file
exportSWF [fileURI] [, bCurrentSettings] Exports document as a SWF
getAlignToDocument Returns the value of the Align to Stage setting
getCustomFill [locationOfFill] Returns the Fill object of selection or toolbar
getCustomStroke [locationOfFill] Returns the Stroke object or toolbar setting
getDataFromDocument name Returns the value of the named data
getElementProperty propertyName Returns the specified Element property
getElementTextAttr attrName [, startIndex] [, endIndex] Returns the specified TextAttrs property
getSelectionRect Returns the bounding rectangle of the selection
getTextString [startIndex] [, endIndex] Returns the text string of the selected text
getTimeline Returns the current timeline
getTransformationPoint Returns the location of the transformation point
group Converts the selection to a group
importPublishProfile fileURI Imports a publish profile from file
importSWF fileURI Imports a SWF into the document
match bWidth, bHeight [, bUseDocumentBounds] Makes the size of selected objects equal
mouseClick position, bToggleSel, bShiftSel Performs a mouse click
mouseDblClk position, bAltDown, bShiftDown, bShiftSelect Performs a mouse double click
moveSelectedBezierPointsBy delta Moves the selected Bezier points
moveSelectionBy distanceToMove Moves the selection
optimizeCurves smoothing, bUseMultiplePasses Opimizes the curves of the selected shape
publish Publishes a document
removeDataFromDocument name Removes persistent data from document
removeDataFromSelection name Removes persistent data from selected objects
renamePublishProfile [profileNewName] Renames the current publish profile
renameScene name Renames the selected scene
reorderScene sceneToMove, sceneToPutItBefore Reorders specified scene
resetTransformation Resets the transformation matrix
revert Reverts the specified document
rotateSelection angle [, rotationPoint] Rotates a selection
save [bOkToSaveAs] Saves document
saveAndCompact [bOkToSaveAs] Saves and compacts document
scaleSelection xScale, yScale [, whichCorner] Scales a selection
selectAll Selects all items on the Stage
selectNone Deselects all items on the Stage
setAlignToDocument bToStage If true, objects are aligned, distributed, sized, or spaced to the Stage
setCustomFill fill Sets the current fill settings of selection or toolbar
setCustomStroke stroke Sets the current stroke settings of selection or toolbar
setElementProperty property, value Sets the specified property of an Element object
setElementTextAttr attrName, attrValue [, startIndex] [, endIndex] Sets the specified property of the selected text items
setFillColor color Changes the fill color of a selection
setInstanceAlpha opacity Sets the opacity of an instance
setInstanceBrightness brightness Sets the brightness of an instance
setInstanceTint color, strength Sets the tint of an instance
setSelectionBounds boundingRectangle Moves and resizes a selection
setSelectionRect rect [, bReplaceCurrentSelection] Sets the selection rectangle
setStroke color, size, stroke Sets stroke properties of selected stroke
setStrokeColor color Changes the stroke color of selected stroke
setStrokeSize size Changes the stroke width of selected stroke
setStrokeStyle stroke Changes the stroke style of selected stroke
setTextRectangle boundingRectangle Changes the bounding rectangle for the selected text item
setTextSelection startIndex, endIndex Sets the text selection of the selected text field
setTextString text [, startIndex] [, endIndex] Adds specifed text string to selected text field
setTransformationPoint transformationPoint Moves the transformation point of selection
skewSelection xSkew, ySkew [, whichEdge] Skews the selection
smoothSelection Smoothes the selected curve of a shape
space direction [, bUseDocumentBounds] Spaces the objects of a selection evenly
straightenSelection Straightens the selected curve of a shape
swapElement name Swaps selected symbol with specifed one
testMovie Test Movie
testScene Test Current Scene
traceBitmap threshold, minimumArea, curveFit, cornerThreshold Traces a bitmap
transformSelection a, b, c, d Performs a general transformation
unGroup Ungroups the selected group
unlockAllElements Unlocks all symbols on the current frame
xmlPanel fileURI Displays the specified XMLUI dialog box

Properties

Name Description
accName Name of movie, used by screen reader
autoLabel If true, turns on automatic labeling for screen reader
backgroundColor A color representing the background
currentPublishProfile Sets and returns the name of the active publish profile
currentTimeline Represents the active timeline
description Description of the main movie, used by screen reader
forceSimple If true, the children of the object are not accessible to screen reader
frameRate Document's frames per second
height Height of the document
library Represents the document's Library
livePreview If true, visually displays components at authortime
name Name of the document
path The file path of the document
publishProfiles An array containing the publish profiles for document
screenOutline The current ScreenOutline object for the document
selection An array of selected Element objects
silent If true, movie is not read by screen reader
timelines An array containing the Timeline objects of the document
width Width of the document

8. DrawingLayer

Used by tools for temporary drawing while dragging the mouse

Methods

Name Args Description
beginDraw [persistentDraw] Puts Flash into drawing mode
beginFrame Starting point to delimit a set of lines
cubicCurveTo x1Ctrl, y1Ctrl, x2Ctl, y2Ctl, xEnd, yEnd Draws a cubic curve
curveTo x1Clt, y, x2, y2 Draws a quadratic curve segment
drawPath path Draws the specified path
endDraw Exits drawing mode
endFrame Erases the paths drawn by DrawingLayer object
lineTo x, y Draws a line
moveTo x, y Sets the current drawing position
newPath Returns a new path object
setColor color Sets the color of subsequently drawn data

9. Edge

Represents an edge of an object on the Stage

Methods

Name Args Description
getControl int i Returns the control point of the specified Edge object
getHalfEdge index Returns a HalfEdge object
setControl index, x, y Sets the control point of an edge
splitEdge t Divides specified Edge object into two

Properties

Name Description
id An unique identifier for the Edge object
isLine If true, Edge is a straight line

10. Effect

An instance of an effect

Properties

Name Description
effectName Name of an effect, used to create menu item
groupName Name of an effect group, used to create the menu item
sourceFile Name of JSFL source file
symbolType Name of symbolType to create during initial application of the effect
useXMLToUI If true, displays a XMLUI dialog box

11. Element

Represents all objects on the Stage

Methods

Name Args Description
getPersistentData name Returns the value of the named data
hasPersistentData name If true, data with specified name is attached to object
removePersistentData name Removes persistent data attached to object
setPersistentData name, type, value Stores specified data with an object

Properties

Name Description
depth Returns the drawing order of the objects on stage
elementType Type of Element object
height Height of the Element
left Left side of Element
locked If true, the Element is locked
matrix References the TransformationMatrix object
name Instance Name of Element
top Top side of Element
width Width of the Element

12. EmbeddedVideoInstance

Subclass of Instance; an embedded video instance on the Stage

13. Fill

Fill settings for the selection or Toolbar

Properties

Name Description
color The fill color
colorArray An array of colors in a gradient
posArray Indicates the position of the corresponding color in a gradient
style The fill style

14. Flash

The Flash application

Methods

Name Args Description
browseForFileURL browseType [, title] [, previewArea] Brings up an Open or Save dialog box
closeAll Closes all open documents
closeDocument documentObject [, bPromptToSaveChanges] Closes the specified document
createDocument [docType] Opens a new document
enableImmediateUpdates If true, updates to the timeline display when executing an effect. Only used for debugging effect.
fileExists fileURI Returns true if specified file exists
findDocumentIndex name Returns the specified Document object's index
findScreenType name [, version] Returns the specified ScreenType
getDocumentDOM Returns the active Document object
invokeScreenType name [, version] Invokes a ScreenType
openDocument fileURI Opens specified FLA file
quit [bPromptIfNeeded] Quits Flash
reloadEffects Reloads all effects descriptors
reloadTools Rebuilds the Toolbar
revertDocument documentObject Reverts specified document
runScript fileURI [, funcName] [, arg] Executes a JavaScript file
saveAll Saves all open documents
saveDocument document [, fileURI] Saves specified document
saveDocumentAs document Displays the Save As dialog
setActiveWindow document [, bActivateFrame] Sets the active window to be the specified document
trace message Sends a test string to the Output panel

Properties

Name Description
activeEffect The effect descriptor
componentsPanel Reference to the Components panel
configDirectory Contains the full path name for local user's Configuration directory
configURI Returns the URI to the local user's config directory
documents An array of Document objects
effects An array of effect descriptors
Math Reference to a Math object
outputPanel Reference to Output panel object
screenTypes An array of all ScreenType objects in the system
tools An array of ToolsObj objects
version Returns the Flash authoring tool's version
viewMatrix References the TransformationMatrix object
xmlui References a XMLUI dialog box

15. FolderItem

Subclass of Item; a folder in the Library

16. FontItem

Subclass of Item; a font symbol in the Library

17. Frame

A frame on the Timeline

Properties

Name Description
actionScript String containing the ActionScript on a frame
duration Number of frames in a frame span
elements An array of Element objects
labelType This specifies the type of frame label
motionTweenOrientToPath If true, object tweens oriented to path
motionTweenRotate Specifies if the object rotates during tween
motionTweenRotateTimes Number of rotations
motionTweenScale If true, object scales while tweening
motionTweenSnap If true, object snaps to motion guide
motionTweenSync If true, tween synchronizes symbols
name Label of the frame
shapeTweenBlend Specifieds the blend setting for a shape tween
soundEffect The effects on the sound
soundLibraryItem Library item used to instantiate a sound
soundLoop Specifies the number of times a sound loops
soundLoopMode Specifies whether sound should loop or repeat indefinitely
soundName Name of sound
soundSync Specifies the sync behavior of a sound
startFrame The frame number of the first frame in a span
tweenEasing The amount of easing
tweenType The type of tween

18. Functions

Flash JavaScript functions

19. HalfEdge

Half of an edge of a contour

Methods

Name Args Description
getEdge Returns the Edge object that contains the HalfEdge
getNext Returns the next HalfEdge
getOppositeHalfEdge Returns the oposite HalfEdge object
getPrev Returns the preceding HalfEdge
getVertex Returns the vertex of the HalfEdge

Properties

Name Description
id An unique identifier for the HalfEdge
index The index of the HalfEdge in the parent Edge

20. Instance

Subclass of Element; an instance on the Stage

Properties

Name Description
instanceType Type of Instance
libraryItem Library item used to instantiate Instance

21. Item

Items in the Library

Methods

Name Args Description
addData name, type, data Adds persistent data to Item
getData name Returns the value of the named data
hasData name If true, the Library item has the named data
removeData name Removes persistent data from the Library item

Properties

Name Description
itemType The symbol type of the Item
linkageClassName Specifies an ActionScript 2 class to associate with symbol
linkageExportForAS If true, the Item will be exported for ActionScript
linkageExportForRS If true, the Item will be exported for runtime sharing
linkageExportInFirstFrame If true, the Item will be exported in the first frame
linkageIdentifier The name of the symbol when referenced by ActionScript or runtime sharing
linkageImportForRS If true, the Item will be imported for runtime sharing
linkageURL Location of the shared asset SWF
name Name of the Library item

22. Layer

A layer on the Timeline

Properties

Name Description
color The color used to outline objects on the layer
frameCount Total number of frames in the Layer
frames An array of Frame objects
height Height of the Layer
layerType Specifies the Layer type
locked If true, Layer is locked
name Name of the Layer
outline If TRUE, Layer is displayed as outlines
parentLayer Defines the Layers's parent Layer
visible If true, Layer is visible

23. Library

The Library panel

Methods

Name Args Description
addItemToDocument position [, namePath] Adds an Item from the Library to the document
addNewItem type [, namePath] Creates a new Item
deleteItem [namePath] Deletes an Item
duplicateItem [namePath] Makes a copy of the currently selected Item
editItem [namePath] Returns true if the specified Item is editable
expandFolder bExpand [, bRecurseNestedParents] [, namePath] If true, expands folder; if false collapses it
findItemIndex namePath Returns an object containing the index of the Item
getItemProperty property Returns specified property for a selected Item
getItemType [namePath] Returns the type of the specified Item
getSelectedItems Returns an array containing the selected Items
importEmbeddedSWF linkageName, swfData [, libName] Imports a contained SWF to the Library
itemExists namePath Returns true if the specified Item exists
moveToFolder folderPath [, itemToMove] [, replace] Moves Item into a folder
newFolder [namePath] Creates a new Folder
renameItem namePath Renames selected Item
selectAll [] Selects all Items
selectItem namePath [, bReplaceCurrentSelection] [, bSelect] Selects specified Item
selectNone Deselects all Items
setItemProperty property, value Sets specified property for the currently selected Items
updateItem [namePath] Updates specified Item

Properties

Name Description
items An array containing all Item objects in the Library

24. LinkedVideoInstance

Subclass of Instance; a linked video instance on the Stage

25. Math

Used to do common mathematical operations

Methods

Name Args Description
concatMatrix mat1, mat2 Performs concatenates the specified Matrix objects
invertMatrix mat Returns the inverse of specified Matrix
pointDistance pt1, pt2 Computes the distance between specified points

26. Matrix

The transformation matrix

Properties

Name Description
a The scale factor to the x axis
b Skews object by moving right edge along vertical axis
c Skews object by moving bottom edge along horizontal axis
d The scale factor to the y axis
tx The location of the object along the x axis
ty The location of the object along the y axis

27. OutputPanel

The Output panel

Methods

Name Args Description
clear Clears contents from the panel
save fileURI [, bAppendToFile] Saves the contents of the Output Panel to a file
trace message Sends a test string to the Output panel

28. Parameter

Parameters for a Screen or Component

Methods

Name Args Description
insertItem index, name, value, type Inserts Parameter into a list, object, or array
removeItem index Deletes Parameter from a list, object, or array

Properties

Name Description
category Groups items in the Components panel, or organizes Screens
listIndex The value of the specified item; for type list only
name The name of Parameter
value The value of the property
valueType The property's value type
verbose Determines if Parameter appears in Properties Inspector

29. Path

Contains a defined sequence of line segments

Methods

Name Args Description
addCubicCurve xAnchor, yAnchor, x1, y1, x2, y, x4, y4 Appends a cubic Bezier curve segment to Path
addCurve x0, y0, x1, y1 Appends a quadratic Bezier segment to Path
addPoint x, y Adds a point to the Path
clear Removes all points from the Path
close Appends a point at the location of the first point of the Path
makeShape [bSupressFill] [, bSupressStroke] Creates a shape
newContour Starts a new Contour in the Path

Properties

Name Description
nPts Returns integer representing the number of points in the Path

30. Screen

A Screen in the ScreenOutline

Properties

Name Description
accName Name of an object, used by screen reader
childScreens An array of child Screens
description Description of the object, used by screen reader
forceSimple If true, the children of the object are not accessible to screen reader
hidden If true, Screen is not visible by any other Screens
instanceName The Screen's instance name
name The name of the Screen
nextScreen The next sibling in a childScreen array
parameters The properties in the Screen's Property Inspector
parentScreen A Screen which has childScreens
prevScreen The previous sibling in a childScreen array
screenType The ScreenType which created the Screen
screenTypeVersion The template version which created the Screen
silent If true, object is not read by screen reader
tabIndex tabIndex value of an object
timeline The Timeline object for a Screen

31. ScreenOutline

The Screen Outline pane

Methods

Name Args Description
copyScreenFromFile fileURI [, screenName] Inserts all Screens from specified URI
deleteScreen [screenName] Deletes a Screen
duplicateScreen [screenName] Duplicates a Screen
getSelectedScreens Returns an array of selected Screens
insertNestedScreen [name] [, referenceScreen] [, screenTypeName] Inserts a child screen
insertScreen [name] [, referenceScreen] [, screenTypeName] Adds a new Screen
moveScreen screenToMove, referenceScreen, position Relocates a Screen
renameScreen newScreenName [, oldScreenName] [, bDisplayError] Changes Screen's name
setCurrentScreen name Sets current screen
setScreenProperty property, value Sets specified property's value
setSelectedScreens selection, bReplaceCurrentSelection Selects one or more Screens

Properties

Name Description
currentScreen The focused Screen in the Screen Outline pane and on the Stage
screens An array of Screens

32. ScreenType

A single ScreenType

Methods

Name Args Description
closeWizardDialog Closes the prior wizard
getJSFLContext Calls a method defined within a Flash JavaScript document
invoke Invokes a ScreenType wizard
openWizardDialog