Skip to main content
Version: 9.0.2

sb.animationAddStep

sb.animationAddStep(id, stepSata)

Add a step to a created animation. The id must be from a call to sb.animationCreate. The stepData parameter defines the animation step values. NOTE: If both "to" and "delta" are given then the "to" value is used.

Parameters

ParameterTypeDescription
idnumberThe animation id to add the step to.
stepDataobjectAn object containing the animation step values. See Step Data Object for details.

Step Data Object

KeyTypeDescription
keystringThe data key for the animation step to act upon.
ratestringThe animation rate string: [linear
durationnumberThe length of the step (ms).
offsetnumberThe offset from animation start where this step begins (ms).
fromnumberThe value to start the animation at, if not specified the value is the current value of "key".
tonumberThe endpoint for the animation.
deltanumberThe delta for the end of the animation from the start point.

Example:

function createAnimation() {
var stepData = {};
// slide the x position 400 pixels over 2000 ms and auto-destroy
// it on completion
var id = sb.animationCreate(60, 1);
stepData.rate = "linear";
stepData.duration = 2000;
stepData.offset = 0;
stepData.delta = 400;
stepData.key = "mylayer.mycontrol.grd_x";
sb.animationAddStep(id, stepData);
}