beautypg.com

Frame.setcustomease() – Adobe Extending Flash Professional CS5 User Manual

Page 318

background image

296

EXTENDING FLASH PROFESSIONAL

Frame object

Last updated 5/2/2011

var doc = fl.getDocumentDOM();
var my_tl = doc.getTimeline();
t his.getCurrentFrame = function(){
var layer = my_tl.layers[my_tl. c u rrentLayer];
var frame = layer.frames[my_tl.currentFrame];
return frame;
}
var theFrame = getCurrentFrame();
if(theFrame.isMotionObject()){
if (theFrame.hasMotionPath()){
theFrame.selectMotionPath(true);
}
else{
fl.trace("There is no motion path");
}
}else{
fl.trace("It is no motion");
}

frame.setCustomEase()

Availability
Flash 8.

Usage

frame.setCustomEase(property, easeCurve)

Parameters

property

A string that specifies the property the ease curve should be used for. Acceptable values are

"all"

,

"position"

,

"rotation"

,

"scale"

,

"color"

, and

"filters"

.

easeCurve

An array of objects that defines the ease curve. Each array element must be a JavaScript object with x and

y properties.

Returns
Nothing.

Description
Method; specifies an array of control point and tangent endpoint coordinates that describe a cubic Bézier curve to be
used as a custom ease curve. This array is constructed by the horizontal (ordinal: left to right) position of the control
points and tangent endpoints.

Example
The following example sets the ease curve for all properties of the first frame in the first layer to the Bézier curve
specified by the

easeCurve

array:

var theFrame = fl.getDocumentDOM().getTimeline().layers[0].frames[0];

var easeCurve = [ {x:0,y:0}, {x:.3,y:.3}, {x:.7,y:.7}, {x:1,y:1} ];

theFrame.setCustomEase( "all", easeCurve );

This manual is related to the following products: