Skip to content

Latest commit

 

History

History
173 lines (153 loc) · 47.8 KB

File metadata and controls

173 lines (153 loc) · 47.8 KB

document summary

Availability

Flash MX 2004.

Description

The Document object represents the Stage. That is, only FLA files are considered documents. To return the Document object for the current document, use fl.getDocumentDOM()

Method summary

You can use the following methods with the Document object:

MethodDescription
document.addDataToDocument()Stores specified data with a document.
document.addDataToSelection()Stores specified data with the selected objects.
document.addFilter()Applies a filter to the selected objects.
document.addItem()Adds an item from any open document or library to the specified Document object.
document.addNewLine()Adds a new path between two points.
document.addNewOval()Adds a new Oval object in the specified bounding rectangle.
document.addNewPrimitiveOval()Adds a new oval primitive fitting into the specified bounds.
document.addNewPrimitiveRectangle()Adds a new rectangle primitive fitting into the specified bounds.
document.addNewPublishProfile()Adds a new publish profile and makes it the current one.
document.addNewRectangle()Adds a new rectangle or rounded rectangle, fitting it into the specified bounds.
document.addNewScene()Adds a new scene (Timeline object) as the next scene after the currently selected scene and makes the new scene the currently selected scene.
document.addNewText()Inserts a new empty text field.
document.addTaggedSwatch()To add new tagged swatch.
document.addTaggedSwatchWithColor()To add new tagged swatch with the given color string.
document.align()Aligns the selection.
document.allowScreens() - droppedDropped in Adobe Animate.
document.arrange()Arranges the selection on the Stage.
document.breakApart()Performs a break-apart operation on the current selection.
document.canEditSymbol()Indicates whether the Edit Symbols menu and functionality are enabled.
document.canRevert()

Determines whether you can use the document.revert()

fl.revertDocument()

MethodDescription
document.canTestMovie()

Determines whether you can use the

document.testMovie()

document.canTestScene()

Determines whether you can use the

document.testScene()

document.changeFilterOrder()Changes the index of the filter in the Filters list.
document.clipCopy()Copies the current selection from the document to the Clipboard.
document.clipCut()Cuts the current selection from the document and writes it to the Clipboard.
document.clipPaste()Pastes the contents of the Clipboard into the document.
document.close()Closes the specified document.
document.convertLinesToFills()Converts lines to fills on the selected objects.
document.convertSelectionToBitmap()Converts selected objects in the current frame to a bitmap and inserts the bitmap into the library.
document.convertToDoc()Converts a document to expected document type.
document.convertToSymbol()Converts the selected Stage items to a new symbol.
document.crop()Uses the top selected drawing object to crop all selected drawing objects underneath it.
document.debugMovie()Initiates a debug session with the document.
document.deleteEnvelope()Deletes the envelope (bounding box that contains one or more objects) from the selected object.
document.deletePublishProfile()Deletes the currently active profile, if there is more than one.
document.deleteScene()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.
document.deleteSelection()Deletes the current selection on the Stage.
document.deleteTaggedSwatchAtIndex()Deletes tagged swatch with given index.
document.deleteTaggedSwatchByName()Deletes tagged swatch with given name.
document.disableAllFilters()Disables all filters on the selected objects.
document.disableFilter()Disables the specified filter in the Filters list.
document.disableOtherFilters()Disables all filters except the one at the specified position in the Filters list.
document.distribute()Distributes the selection.
document.distributeToKeyframes()Performs a distribute-to-keyframes operation on the current selection; equivalent to selecting Distriute to Keyframes.
document.distributeToLayers()Performs a distribute-to-layers operation on the current selection; equivalent to selecting Distribute to Layers.
document.documentHasData()Checks the document for persistent data with the specified name.
document.duplicatePublishProfile()Duplicates the currently active profile and gives the duplicate version focus.
document.duplicateScene()Makes a copy of the currently selected scene, giving the new scene a unique name and making it the current scene.
document.duplicateSelection()Duplicates the selection on the Stage.
MethodDescription
document.editScene()Makes the specified scene the currently selected scene for editing.
document.enableAllFilters()Enables all the filters on the Filters list for the selected objects.
document.enableFilter()Enables the specified filter for the selected objects.
document.enterEditMode()Switches the authoring tool into the editing mode specified by the parameter.
document.exitEditMode()Exits from symbol-editing mode and returns focus to the next level up from the editing mode.
document.exportCanvasPublishTemplate()Exports the HTML5 Canvas Publishing Template for given document,at the specified location.
document.exportInstanceToLibrary()Export a selected movie clip, graphic, or button instance on the Stage to a new bitmap in the Library.

document.exportInstanceToPNGSequence(

)

Export a selected movie clip, graphic, or button instance on the Stage to a series of PNG files on disk.
document.exportMedia()Generates the required media from the document.
document.exportPNG()Exports the document as one or more PNG files.
document.exportPublishProfile()Exports the currently active profile to an XML file.
document.exportPublishProfileString()Returns a string that specifies, in XML format, the specified profile.
document.exportSVG()Exports the document in SVG format.
document.exportSWF()Exports the document in the Flash SWF format.
document.exportVideo()Exports a video from the document and optionally sends it to Adobe Media Encoder to convert the video.
document.getAlignToDocument()Identical to retrieving the value of the To Stage button in the Align panel.
document.getBlendMode()Returns a string that specifies the blending mode for the selected objects.
document.getCustomFill()Retrieves the fill object of the selected shape, or the Tools panel and Property inspector if specified.
document.getCustomStroke()Returns the stroke object of the selected shape, or the Tools panel and Property inspector if specified.
document.getDataFromDocument()Retrieves the value of the specified data.
document.getElementProperty()Gets the specified Element property for the current selection.
document.getElementTextAttr()Gets a specified TextAttrs property of the selected Text objects.
document.getFilters()Returns an array that contains the list of filters applied to the currently selected objects.
document.getIndexForTaggedSwatchesPalette()To get the Tagged Swatches palette index for given palette name.
document.getMetadata()Returns a string containing the XML metadata associated with the document.
document.getMobileSettings()

Returns the string passed to

document.setMobileSettings().

document.getPlayerVersion()Returns a string that represents the targeted player version for the specified document.
document.getPublishDocumentData()Indicates whether publishing of the specified persistent data is enabled for the specified format in the document.
document.getSelectionRect()Gets the bounding rectangle of the current selection.
Method Description
document.getSWFPathFromProfile() Gets the full path to the SWF file that is set in the current Publish profile.
document.getTaggedSwatchAtIndex() Returns the Tagged Swatch with the given index.
document.getTaggedSwatchByName() Returns the Tagged Swatch with the given name.
document.getTaggedSwatches() Returns array of tagged swatch objects.
document.getTaggedSwatchesPaletteList() To get the array of Tagged Swatches palette name list.
document.getTelemetryForSwf() Indicates whether the "Enable detailed telemetry" checkbox is selected in the Publish Settings dialog.
document.getTextString() Gets the currently selected text.
document.getTimeline() Retrieves the current Timeline object in the document.
document.getTransformationPoint() Gets the location of the transformation point of the current selection.
document.group() Converts the current selection to a group.

| | document.importCanvasPublishTemplate() | Imports and sets the HTML5 Canvas Publishing Template for given document, from the specified location pathURI. | | document.importFile() | Imports a file into the document. | | document.importPublishProfile() | Imports a profile from a file. | | document.importPublishProfileString() | Imports an XML string that represents a publish profile and sets it as the current profile. | | document.importSWF() - dropped | Dropped in Adobe Animate. | | document.intersect() | Creates an intersection drawing object from all selected drawing objects. | | document.loadCuepointXML() - dropped | Dropped in Adobe Animate. | | document.match() | Makes the size of the selected objects the same. | | document.mouseClick() | Performs a mouse click from the Selection tool. | | document.mouseDblClk() | Performs a double mouse click from the Selection tool. | | document.moveSelectedBezierPointsBy() | If the selection contains at least one path with at least one Bézier point selected, this method moves all selected Bézier points on all selected paths by the specified amount. | | document.moveSelectionBy() | Moves selected objects by a specified distance. | | document.optimizeCurves() | Optimizes smoothing for the current selection, allowing multiple passes, if specified, for optimal smoothing; equivalent to selecting Modify >Shape >Optimize. | | document.publish() | Publishes the document according to the active publish settings (File >Publish Settings); equivalent to selecting File >Publish. | | document.punch() | Uses the top selected drawing object to punch through all selected drawing objects underneath it. | | document.removeAllFilters() | Removes all filters from the selected objects. | | document.removeDataFromDocument() | Removes persistent data with the specified name that has been attached to the document. | | document.removeDataFromSelection() | Removes persistent data with the specified name that has been attached to the selection. | | document.removeFilter() | Removes the specified filter from the Filters list of the selected objects. | | document.renamePublishProfile() | Renames the current profile. | | document.renameScene() | Renames the currently selected scene in the Scenes panel. |

Method Description
document.reorderScene() Moves the specified scene before another specified scene.
document.resetOvalObject() Sets all values in the Property inspector to default Oval object settings.
document.resetRectangleObject() Sets all values in the Property inspector to default Rectangle object settings.
document.resetTransformation() Resets the transformation matrix; equivalent to selecting Modify >Transform >Remove Transform.
document.revert() Reverts the specified document to its previously saved version; equivalent to selecting File >Revert.
document.rotate3DSelection() Applies a 3D rotation to the selection.
document.rotateSelection() Rotates the selection by a specified number of degrees.
document.save() Saves the document in its default location; equivalent to selecting File >Save.
document.saveAsCopy() Saves a copy of the document to a specified location.
document.saveAndCompact() - dropped Dropped in Adobe Animate.
document.scaleSelection() Scales the selection by a specified amount; equivalent to using the Free Transform tool to scale the object.
document.selectAll() Selects all items on the Stage; equivalent to pressing Control+A (Windows) or Command+A (Macintosh) or selecting Edit >Select All.
document.selectNone() Deselects any selected items.
document.setAlignToDocument() Sets the preferences for document.align(), document.distribute(), document.match(), and document.space() to act on the document; equivalent to enabling the To Stage button in the Align panel.
document.setBlendMode() Sets the blending mode for the selected objects.
document.setCustomFill() Sets the fill settings for the Tools panel, Property inspector, and any selected shapes.
document.setCustomStroke() Sets the stroke settings for the Tools panel, Property inspector, and any selected shapes.
document.setElementProperty() Sets the specified Element property on selected objects in the document.
document.setElementTextAttr() Sets the specified TextAttrs property of the selected text items to the specified value.
document.setFillColor() Changes the selection and the tools panel to the specified color.
document.setFilterProperty() Sets a specified filter property for the currently selected objects.
document.setFilters() Applies filters to the selected objects.
document.setInstanceAlpha() Sets the opacity of the instance.
document.setInstanceBrightness() Sets the brightness for the instance.
document.setInstanceTint() Sets the tint for the instance.
Method Description
document.setMetadata() Sets the XML metadata for the specified document, overwriting any existing metadata.
document.setMobileSettings() Sets the value of an XML settings string in a mobile FLA file.
document.setOvalObjectProperty() Specifies a value for a specified property of primitive Oval objects.
document.setPlayerVersion() Sets the version of the Flash Player targeted by the specified document.
document.setRectangleObjectProperty() Specifies a value for a specified property of primitive Rectangle objects.
document.setSelectionBounds() Moves and resizes the selection in a single operation.
document.setSelectionRect() Draws a rectangular selection marquee relative to the Stage, using the specified coordinates.
document.setStageVanishingPoint() Specifies the vanishing point for viewing 3D objects.
document.setStageViewAngle() Specifies the perspective angle for viewing 3D objects.
document.setStroke() Sets the color, width, and style of the selected strokes.
document.setStrokeColor() Changes the stroke color of the selection to the specified color.
document.setStrokeSize() Changes the stroke size of the selection to the specified size.
document.setStrokeStyle() Changes the stroke style of the selection to the specified style.

| | document.setTaggedSwatchAtIndex() | Replace the tagged swatch with the given index to the given new swatch object.
| | document.setTaggedSwatchByName() | Replace the tagged swatch with the given name to the given new swatch object | | document.setTextRectangle() | Changes the bounding rectangle for the selected text item to the specified size. | | document.setTextSelection() | Sets the text selection of the currently selected text field to the values specified by the startIndex and endIndex values. | | document.setTextString() | Inserts a string of text. | | document.setTransformationPoint() | Moves the transformation point of the current selection. | | document.skewSelection() | Skews the selection by a specified amount. | | document.smoothSelection() | Smooths the curve of each selected fill outline or curved line. | | document.space() | Spaces the objects in the selection evenly. | | document.straightenSelection() | Straightens the currently selected strokes; equivalent to using the Straighten button in the Tools panel. | | document.swapElement() | Swaps the current selection with the specified one. | | document.swapStrokeAndFill() | Swaps the Stroke and Fill colors. | | document.testMovie() | Executes a Test Movie operation on the document. | | document.testScene() | Executes a Test Scene operation on the current scene of the document. | | document.traceBitmap() | Performs a trace bitmap on the current selection; equivalent to selecting Modify>Bitmap>Trace Bitmap. | | document.transformSelection() | Performs a general transformation on the current selection by applying the matrix specified in the arguments. | | document.translate3DCenter() | Sets the XYZ position around which the selection is translated or rotated. |

Method Description
document.translate3DSelection() Applies a 3D translation to the selection.
document.unGroup() Ungroups the current selection.
document.union() Combines all selected shapes into a drawing object.
document.unlockAllElements() Unlocks all locked elements on the currently selected frame.
document.xmlPanel() Posts a XMLUI dialog box.

Property summary

You can use the following properties with the Document object.

Property Description
document.accName A string that is equivalent to the Name field in the Accessibility panel.
document.as3AutoDeclare A Boolean value that describes whether the instances placed on the Stage are automatically added to user-defined timeline classes.
document.as3Dialect A string that describes the ActionScript 3.0 "dialect" being used in the specified document.
document.as3ExportFrame An integer that specifies in which frame to export ActionScript 3.0 classes.
document.as3StrictMode A Boolean value that specifies whether the ActionScript 3.0 compiler should compile with the Strict Mode option turned on or off.
document.as3WarningsMode A Boolean value that specifies whether the ActionScript 3.0 compiler should compile with the Warnings Mode option turned on or off.
document.asVersion An integer that specifies which version of ActionScript is being used in the specified file.
document.autoLabel A Boolean value that is equivalent to the Auto Label check box in the Accessibility panel.
document.backgroundColor A string, hexadecimal value, or integer that represents the background color.
document.currentPublishProfile A string that specifies the name of the active publish profile for the specified document.
document.currentTimeline An integer that specifies the index of the active timeline.
document.description A string that is equivalent to the Description field in the Accessibility panel.
document.docClass Specifies the top-level ActionScript 3.0 class associated with the document.
document.externalLibraryPath A string that contains a list of items in the document’s ActionScript 3.0 External library path, which specifies the location of SWC files used as runtime shared libraries.
document.forceSimple A Boolean value that specifies whether the children of the specified object are accessible.
document.frameRate A float value that specifies the number of frames displayed per second when the SWF file plays; the default is 12.
document.height An integer that specifies the height of the document (Stage) in pixels.
Property Description
document.id A unique integer (assigned automatically) that identifies a document during a Flash session.
document.library Read-only; the library object for a document.
document.libraryPath A string that contains a list of items in the document’s ActionScript 3.0 Library path, which specifies the location of SWC files or folders containing SWC files.
document.livePreview A Boolean value that specifies whether Live Preview is enabled.
document.name Read-only; a string that represents the name of a document (FLA file).
document.path Read-only; a string that represents the path of the document, in a platform-specific format.
document.pathURI Read-only; a string that represents the path of the document, expressed as a file:/// URI.
document.publishProfiles Read-only; an array of the publish profile names for the document.
document.screenOutline - dropped Dropped in Adobe Animate.
document.selection An array of the selected objects in the document.
document.silent A Boolean value that specifies whether the object is accessible.
document.sourcePath A string that contains a list of items in the document’s ActionScript 3.0 Source path, which specifies the location of ActionScript class files.
document.swfJPEGQuality An integer that returns the JPEG Quality setting from the current Publish Profile in the document.
document.timelines Read-only; an array of Timeline objects (see Timeline object).
document.viewMatrix Read-only; a Matrix object.
document.width An integer that specifies the width of the document (Stage) in pixels.
document.zoomFactor Specifies the zoom percent of the Stage at authoring time.