Log in

View Full Version : Using bounds



evan
07-30-2008, 04:20 PM
can I set a rectangular boundry programatically rather than what I have been doing

wich is placing a sprite and assigning event listeners like this:


pad.addEventListener(MouseEvent.ROLL_OUT,hideThis, false, 0, true);
and


pad.addEventListener(MouseEvent.ROLL_OVER,showThis, false, 0, true);

it works but I'm looking for another way to improve on an idea.

Medyman
07-31-2008, 12:14 AM
Not sure if this is what you want, but you might want to look at the getBounds() method (http://livedocs.adobe.com/flex/201/langref/flash/display/DisplayObject.html#getBounds()) in the DisplayObject class.

evan
07-31-2008, 02:47 PM
I hope this better illustrates what I have in mind:


function testcirc(evt:Event):void
{

if(circ(25,25,200,200))

{
trace("circ is in the boundry")
}
}