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|
Rating: 9 Votes: 13
|I have a passion for Actionscript.|
|Download the files used in this tutorial.|
|Download (0 kb)|
|More help? Search our boards for quick answers!|