sourceRectAtTime() ?

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

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.
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

Something like this:

Code: Select all

var boundsObject = theLayer.sourceRectAtTime(0, true);
alert(boundsObject.top);
User avatar
Atomic
Posts: 157
Joined: April 30th, 2007, 5:55 am
Location: United States, Ohio

Hmm...that's neat, I suppose you could use that for collision detection (ie hittest).
Post Reply