PDA

View Full Version : hitTestPoint help



zombieLincoln
May 25th, 2008, 12:57 AM
I can't figure out hitTestPoint. I'm trying to make this map of the US and each state needs to do something when you mouse over the state, but the overlaps are killing me as movie clips are square and states are not. I'm new to AS3 and was hoping someone could help me out.

chris12295
May 25th, 2008, 01:11 AM
If each state is a separte MovieClip or sprite, you can use the mouseover event

yaim0310
May 25th, 2008, 01:58 AM
What don't you understand about hitTestPoint()? Set the 3rd parameter to true. hitTestPoint(x,y,[shapeFlag]);

shapeFlag:Boolean (default = false) — Whether to check against the actual pixels of the object (true) or the bounding box (false).

zombieLincoln
May 25th, 2008, 08:35 AM
What I don't get is the x and y positions, and what they are the positions of.

Felixz
May 25th, 2008, 09:54 AM
they are ur point coordinates which u want to hitTest

zombieLincoln
May 25th, 2008, 04:47 PM
so the x and y of the movie clip?

Felixz
May 25th, 2008, 05:11 PM
usually it is used for mouse coordinates

zombieLincoln
May 25th, 2008, 05:21 PM
If I needed to do rollovers on states on a map would this be the way to go? I tried just adding listeners to the states and tracing the output and it picks up the box area. Any suggestions would be appreciated

Felixz
May 26th, 2008, 07:04 AM
Why not have those states as separate clips and add there MOUSE_OVER Event