Search tutorials
There are 4 key terms that are associated with getBounds: xMin, xMax, yMin, and yMax. These 4 are used to determine the boundaries of the object youre targeting.
In Flash, the center of the Cartesian plane begins in the top left corner, and is reversed, as going right and going downwards is positive. This means the right edge of the square in the diagram is its maximum, left edge its minimum, and the same for the top and bottom edges. When we use getBounds, we get these 4 values, and then, if using hitTest, compare them to the object that we want to target. So for example, if I had a 10x10 square, and I placed the squares center point at: x=45 y=50, then the xMin=40, xMax=50, yMin=45, and yMax=55.
| » Level Intermediate |
|
Added: 2006-01-04 Rating: 9 Votes: 13 |
| » Author |
| I have a passion for Actionscript. |
| » Download |
| Download the files used in this tutorial. |
| Download (0 kb) |
| » Forums |
| More help? Search our boards for quick answers! |
-
You must have javascript enabled in order to post comments.


Comments
There are no comments yet. Be the first to comment!