Page 1 of 1

sourceRectAtTime() ?

Posted: October 9th, 2007, 1:57 pm
by byronnash
How do you get a value out of the sourceRectAtTime() function? The docs say that it returns "A JavaScript object with four attributes, [top, left, width, height]." Is that supposed to be an array or what? I need to find the width value.

Posted: October 9th, 2007, 2:25 pm
by Paul Tuersley
Something like this:

Code: Select all

var boundsObject = theLayer.sourceRectAtTime(0, true);
alert(boundsObject.top);

Posted: October 10th, 2007, 1:27 pm
by Atomic
Hmm...that's neat, I suppose you could use that for collision detection (ie hittest).