beautypg.com

Document.debugmovie() – Adobe Extending Flash Professional CS5 User Manual

Page 108

background image

86

EXTENDING FLASH PROFESSIONAL

Document object

Last updated 5/2/2011

Description
Property; an integer that specifies the index of the active timeline. You can set the active timeline by changing the value
of this property; the effect is almost equivalent to calling

document.editScene()

. The only difference is that you

don’t get an error message if the index of the timeline is not valid; the property is simply not set, which causes silent
failure.

Example
The following example displays the index of the current timeline:

var myCurrentTL = fl.getDocumentDOM().currentTimeline;

fl.trace("The index of the current timeline is: "+ myCurrentTL);

The following example changes the active timeline from the main timeline to a scene named

"myScene"

:

var i = 0;

var curTimelines = fl.getDocumentDOM().timelines;

while(i < fl.getDocumentDOM().timelines.length){

if(curTimelines[i].name == "myScene"){

fl.getDocumentDOM().currentTimeline = i;

}

++i;

}

See also

document.getTimeline()

document.debugMovie()

Availability
Flash Professional CS5.

Usage

document.DebugMovie([Boolean abortIfErrorsExist])

Description
Method; Invokes the Debug Movie command on the document.

Parameters

abortIfErrorsExist

Boolean; the default value is false. If set to true, the debug session will not start and the .swf

window will not open if there are compiler errors. Compiler warnings will not abort the command.

Example
The following example opens the current document in debug mode, but aborts the operation if compiler errors exist:

fl.getDocumentDOM().debugMovie(1);

This manual is related to the following products: