Detailed instructions for use are in the User's Guide.
[. . . ] Extending Flash
Trademarks 1 Step RoboPDF, ActiveEdit, ActiveTest, Authorware, Blue Sky Software, Blue Sky, Breeze, Breezo, Captivate, Central, ColdFusion, Contribute, Database Explorer, Director, Dreamweaver, Fireworks, Flash, FlashCast, FlashHelp, Flash Lite, FlashPaper, Flash Video Encoder, Flex, Flex Builder, Fontographer, FreeHand, Generator, HomeSite, JRun, MacRecorder, Macromedia, MXML, RoboEngine, RoboHelp, RoboInfo, RoboPDF, Roundtrip, Roundtrip HTML, Shockwave, SoundEdit, Studio MX, UltraDev, and WebHelp are either registered trademarks or trademarks of Macromedia, Inc. and may be registered in the United States or in other jurisdictions including internationally. Other product names, logos, designs, titles, words, or phrases mentioned within this publication may be trademarks, service marks, or trade names of Macromedia, Inc. or other entities and may be registered in certain jurisdictions including internationally. [. . . ] A string that specifies how a shape tween is blended between the shape in the keyframe at the start of the tween and the shape in the following keyframe. A string that specifies effects for a sound that is attached directly to a frame (frame. soundLibraryItem). An integer value that specifies the number of times a sound that is attached directly to a frame (frame. soundLibraryItem) plays. A string that specifies whether a sound that is attached directly to a frame (frame. soundLibraryItem) should play a specific number of times or loop indefinitely. A string that specifies the name of a sound that is attached directly to a frame (frame. soundLibraryItem), as stored in the library. A string that specifies the sync behavior of a sound that is attached directly to a frame (frame. soundLibraryItem). An integer that specifies the amount of easing that should be applied to the tweened object.
frame. motionTweenScale
frame. motionTweenSnap
frame. motionTweenSync
frame. name frame. shapeTweenBlend
frame. soundEffect
frame. soundLibraryItem
frame. soundLoop
frame. soundLoopMode
frame. soundName
frame. soundSync
frame. startFrame frame. tweenEasing
274
Objects
Property
frame. tweenType frame. useSingleEaseCurve
Description
A string that specifies the type of tween. A Boolean value that specifies whether a single custom ease curve is used for easing information for all properties.
frame. actionScript
Availability
Flash MX 2004.
Usage
frame. actionScript
Description
Property; a string that represents ActionScript code. To insert a new line character, use "\\n".
Example
The following example assigns stop() to first frame top layer action:
fl. getDocumentDOM(). getTimeline(). layers[0]. frames[0]. actionScript = 'stop();';
frame. duration
Availability
Flash MX 2004.
Usage
frame. duration
Description
Read-only property; an integer that represents the number of frames in a frame sequence.
Example
The following example stores the number of frames in a frame sequence that starts at first frame in the top layer in the frameSpan variable:
var frameSpan = fl. getDocumentDOM(). getTimeline(). layers[0]. frames[0]. duration;
Frame object
275
frame. elements
Availability
Flash MX 2004.
Usage
frame. elements
Description
Read-only property; an array of Element objects (see Element object). The order of elements is the order in which they are stored in the FLA file. If there are multiple shapes on the Stage, and each is ungrouped, Flash treats them as one element. If each shape is grouped, so there are multiple groups on the Stage, Flash sees them as separate elements. In other words, Flash treats raw, ungrouped shapes as a single element, regardless of how many separate shapes are on the Stage. If a frame contains three raw, ungrouped shapes, for example, then elements. length in that frame returns a value of 1. Select each shape individually, and group it to work around this issue.
Example
The following example stores an array of current elements on the top layer, first frame in the myElements variable:
var myElements = fl. getDocumentDOM(). getTimeline(). layers[0]. frames[0]. elements;
frame. getCustomEase()
Availability
Flash 8.
Usage
Frame. getCustomEase( [ property ] )
Parameters
An optional string that specifies the property for which you want to return the custom ease value. Acceptable values are "all", "position", "rotation", "scale", "color", and "filters". The default value is "all".
property
Returns
Returns an array of JavaScript objects, each of which has an x and y property.
276
Objects
Description
Method; returns an array of objects that represent the control points for the cubic Bézier curve that defines the ease curve.
Example
The following example returns the custom ease value of the position property for the first frame in the top layer:
var theFrame = fl. getDocumentDOM(). getTimeline(). layers[0]. frames[0] var easeArray = theFrame. getCustomEase( "position" );
See also
frame. hasCustomEase, frame. setCustomEase(), frame. useSingleEaseCurve
frame. hasCustomEase
Availability
Flash 8.
Usage
frame. hasCustomEase
Description
Property; a Boolean value. If true, the frame gets its ease information from the custom ease curve. If false, the frame gets its ease information from the ease value.
Example
The following example specifies that the first frame in the top layer should get its ease information from the ease value rather than the custom ease curve:
var theFrame = fl. getDocumentDOM(). getTimeline(). layers[0]. frames[0] theFrame. hasCustomEase = false;
See also
frame. getCustomEase(), frame. setCustomEase(), frame. useSingleEaseCurve
Frame object
277
frame. labelType
Availability
Flash MX 2004.
Usage
frame. labelType
Description
Property; a string that specifies the type of Frame name. Acceptable values are "none", "name", "comment", and "anchor". Setting a label to "none" clears the frame. name property.
Example
The following example sets the name of the first frame in the top layer to "First Frame" and then sets its label to "comment":
fl. getDocumentDOM(). getTimeline(). layers[0]. frames[0]. name = 'First Frame'; fl. getDocumentDOM(). getTimeline(). layers[0]. frames[0]. labelType = 'comment';
frame. motionTweenOrientToPath
Availability
Flash MX 2004.
Usage
frame. motionTweenOrientToPath
Description
Property; a Boolean value; specifies whether the tweened element rotates the element as it moves along a path to maintain its angle with respect to each point on the path (true) or whether it does not rotate (false). If you want to specify a value for this property, you should set frame. motionTweenRotate to
"none".
278
Objects
frame. motionTweenRotate
Availability
Flash MX 2004.
Usage
frame. motionTweenRotate
Description
Property; a string that specifies how the tweened element rotates. [. . . ] The vp argument is a pointer to the jsval structure into which the contents of the double should be copied.
The C-level API
547
Returns
A Boolean value: JS_TRUE indicates success; JS_FALSE indicates failure.
JSVal JS_BooleanToValue()
Usage
jsval JS_BooleanToValue(JSBool bv);
Description
Method; stores a Boolean return value in a jsval structure.
Arguments
JSBool bv
The bv argument is a Boolean value: JS_TRUE indicates success; JS_FALSE indicates failure.
Returns
A JSVal structure that contains the Boolean value that passes to the function as an argument.
JSVal JS_BytesToValue()
Usage
JSBool JS_BytesToValue(JSContext *cx, unsigned short *bytes, uint sz, jsval *vp);
Description
Method; converts bytes to a JavaScript value.
Arguments
JSContext
*cx, unsigned short bytes, uint sz, jsval *vp
The cx argument is the JavaScript context. The bytes argument is the string of bytes to convert to a JavaScript object. The vp argument is the JavaScript value.
Returns
A Boolean value: JS_TRUE indicates success; JS_FALSE indicates failure.
548
C-Level Extensibility
JSVal JS_IntegerToValue()
Usage
jsval JS_IntegerToValue(long lv);
Description
Method; converts a long integer value to JSVal structure.
Arguments
lv
The lv argument is the long integer value that you want to convert to a jsval structure.
Returns
A JSVal structure that contains the integer that passed to the function as an argument.
JSVal JS_ObjectToValue()
Usage
jsval JS_ObjectToValue(JSObject *obj);
Description
Method; stores an object return value in a JSVal. Use JS_ NewArrayObject() to create an array object; use JS_SetElement() to define its contents.
Arguments
JSObject *obj
The obj argument is a pointer to the JSObject object that you want to convert to a JSVal structure.
Returns
A JSVal structure that contains the object that you passed to the function as an argument.
The C-level API
549
unsigned short *JS_ObjectType()
Usage
unsigned short *JS_ObjectType(JSObject *obj);
Description
Method; given an object reference, returns the class name of the object. [. . . ]