Detailed instructions for use are in the User's Guide.
[. . . ] Flash JavaScript Dictionary
Trademarks Add Life to the Web, Afterburner, Aftershock, Andromedia, Allaire, Animation PowerPack, Aria, Attain, Authorware, Authorware Star, Backstage, Bright Tiger, Clustercats, ColdFusion, Contribute, Design In Motion, Director, Dream Templates, Dreamweaver, Drumbeat 2000, EDJE, EJIPT, Extreme 3D, Fireworks, Flash, Flash Lite, Flex, Fontographer, FreeHand, Generator, HomeSite, JFusion, JRun, Kawa, Know Your Site, Knowledge Objects, Knowledge Stream, Knowledge Track, LikeMinds, Lingo, Live Effects, MacRecorder Logo and Design, Macromedia, Macromedia Action!, Macromedia Breeze, Macromedia Flash, Macromedia M Logo and Design, Macromedia Spectra, Macromedia xRes Logo and Design, MacroModel, Made with Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Open Sesame!, Roundtrip, Roundtrip HTML, Shockwave, Sitespring, SoundEdit, Titlemaker, UltraDev, Web Design 101, what the web can be, and Xtra 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. [. . . ] To begin the motion tween slowly and accelerate the tween toward the end of the animation, use a value between -1 and -100. To begin the motion tween rapidly and decelerate the tween toward the end of the animation, use a positive value between 1 and 100.
Example
The following example specifies that the motion of the tweened object should begin fairly rapidly and decelerate toward the end of the animation:
fl. getDocumentDOM(). getTimeline(). layers[0]. frames[0]. tweenEasing = 50;
frame. tweenType
Availability
Flash MX 2004.
Usage frame. tweenType Description
Property; a string that specifies the type of tween; valid values are "motion", "shape", or "none". The value "none" removes the motion tween. Use the timeline. createMotionTween() method to create a tween. If you specify "motion", the object in the frame must be a symbol, text field, or grouped object. It will be tweened from its location in the current keyframe to the location in the following keyframe. If you specify "shape", the object in the frame must be a shape. It will blend from its shape in the current keyframe to the shape in the following keyframe.
Example
The following example specifies that the object is a motion tween, and therefore, it should be tweened from its location in the current keyframe to the location in the following keyframe:
fl. getDocumentDOM(). getTimeline(). layers[0]. frames[0]. tweenType = "motion";
194
Chapter 3: Objects
HalfEdge object
Availability
CHAPTER 3 Objects
Flash MX 2004.
Description
The halfEdge object is the directed side of the edge of a Shape object. You can transverse the contours of a shape by "walking around" these half edges. For example, starting from a half edge, you can visit all the half edges around a contour of a shape, and return to the original half edge. One half edge represents one side of the edge; the other half edge represents the other side. Method summary for the HalfEdge object The following methods are available for the halfEdge object:
Method
halfEdge. getEdge() halfEdge. getNext()
Description Gets the Edge object for the halfEdge object. Gets the next half edge on the current contour.
halfEdge. getOppositeHalfEdge() Gets the halfEdge object on the other side of the edge. halfEdge. getPrev() halfEdge. getVertex()
Gets the preceding halfEdge object on the current contour. Gets the Vertex object at the head of the halfEdge object.
Property summary for the HalfEdge object The following properties are available for the halfEdge object:
Property
halfEdge. id
Description Read-only; a unique integer identifier for the halfEdge object.
halfEdge. getEdge()
Availability
Flash MX 2004.
Usage halfEdge. getEdge() Parameters
None.
Returns
An Edge object.
HalfEdge object
195
Description
Method; gets the Edge object for the halfEdge object.
Example
The following example illustrates getting an edge and a half edge for the specified shape.
var shape = fl. getDocumentDOM(). selection[0]; var halfEdge = shape. edges[0]. getHalfEdge(0); var edge = halfEdge. getEdge();
halfEdge. getNext()
Availability
Flash MX 2004.
Usage halfEdge. getNext() Parameters
None.
Returns
A halfEdge object.
Description
Method; gets the next half edge on the current contour.
Note: Although half edges have a direction and a sequence order, edges do not. Example
The following example stores the next half edge of the specified contour in the nextHalfEdge variable:
var shape = fl. getDocumentDOM(). selection[0]; var hEdge = shape. edges[0]. getHalfEdge( 0 ); var nextHalfEdge = hEdge. getNext();
halfEdge. getOppositeHalfEdge()
Availability
Flash MX 2004.
Usage halfEdge. getOppositeHalfEdge() Parameters
None.
Returns
A halfEdge object.
196
Chapter 3: Objects
Description
Method; gets the halfEdge object on the other side of the edge.
Example
The following example stores the half edge opposite hEdge in the otherHalfEdge variable:
var shape = fl. getDocumentDOM(). selection[0]; var hEdge = shape. edges[0]. getHalfEdge(0); var otherHalfEdge = hEdge. getOppositeHalfEdge();
halfEdge. getPrev()
Availability
Flash MX 2004.
Usage halfEdge. getPrev() Parameters
None.
Returns
A halfEdge object.
Description
Method; gets the preceding halfEdge object on the current contour.
Note: Although half edges have a direction and a sequence order, edges do not. Example
The following example stores the previous half edge of the specified contour in the prevHalfEdge variable:
var shape = fl. getDocumentDOM(). selection[0]; var hEdge = shape. edges[0]. getHalfEdge( 0 ); var prevHalfEdge = hEdge. getPrev();
halfEdge. getVertex()
Availability
Flash MX 2004.
Usage halfEdge. getVertex() Parameters
None.
Returns
A Vertex object.
HalfEdge object
197
Description
Method; gets the Vertex object at the head of the halfEdge object.
Example
The following example stores the Vertex object at the head of hEdge in the vertex variable:
var var var var shape = fl. getDocumentDOM(). selection[0]; edge = shape. edges[0]; hEdge = edge. getHalfEdge(0); vertex = hEdge. getVertex();
halfEdge. id
Availability
Flash MX 2004.
Usage halfEdge. id Description
Read-only property; a unique integer identifier for the halfEdge object.
Example
The following example displays a unique identifier for the specified half edge in the Output panel:
var shape = fl. getDocumentDOM(). selection[0]; alert(shape. contours[0]. getHalfEdge(). id);
198
Chapter 3: Objects
Instance object
Inheritance Availability
CHAPTER 3 Objects
Element object > Instance object
Flash MX 2004.
Description
Instance is a subclass of the Element object. Property summary for the Instance object In addition to all of the Element object properties, Instance has the following properties:
Property
instance. instanceType instance. libraryItem
Description Read-only; a string that represents the type of Instance. Library item used to instantiate this instance.
instance. instanceType
Availability
Flash MX 2004.
Usage instance. instanceType Description
Read-only property; a string that represents the type of Instance. Valid values are "symbol", "bitmap", "embedded video", "linked video", and "compiled clip".
Example
The following example shows that the instance type of a movie clip is "symbol":
//select a movie clip, then run this script var type = fl. getDocumentDOM(). selection[0]. instanceType; fl. trace("This instance type is " + type);
instance. libraryItem
Availability
Flash MX 2004.
Usage instance. libraryItem Description
Property; a library item used to instantiate this instance. You can change this property only to another library item of the same type (that is, you cannot set a symbol instance to refer to a bitmap). See library object.
Instance object
199
Example
The following example changes the selected symbol to refer to the first item in the library:
fl. getDocumentDOM(). selection[0]. libraryItem = fl. getDocumentDOM(). library. items[0];
200
Chapter 3: Objects
Item object
Availability
CHAPTER 3 Objects
Flash MX 2004.
Description
The Item object is an abstract base class. [. . . ] For an array object, the function returns "Array".
382
Chapter 4: C-Level Extensibility
Note: Do not modify the returned buffer pointer, or you might corrupt the data structures of the JavaScript interpreter. Arguments JSObject *obj
· Typically, this argument is passed in and converted using the JS_ValueToObject() function.
Returns
A pointer to a null-terminated string. The caller should not free this string when it finishes. JSObject *JS_NewArrayObject()
Usage JSObject *JS_NewArrayObject( JSContext *cx, unsigned int length [, jsval *v ] ) Description
Method; creates a new object that contains an array of JSVals.
Arguments JSContext *cx, unsigned int length, jsval *v
· The cx argument is the opaque JSContext pointer that passes to the JavaScript function. [. . . ]