Solved

hit test of iregular shapes in actionscript

Posted on 2009-05-03
1
519 Views
Last Modified: 2013-11-11
I have a movie clip called shape_mc and it is an iregular shape. I have another movie clip called ball_mc. when I type:   ball_mc.hitTestObject(shape_mc) it takes the bounding boxes and will come true when the ball_mc touches the box of the shape_mc. Is there a way of testing it the ball hits the fill of the irregular shape rather than any part of the box?
0
Comment
Question by:TonoNam
1 Comment
 
LVL 6

Accepted Solution

by:
biyik earned 250 total points
ID: 24293043
Unfortunately, hitTestObject uses a very basic test, rectangular collision test, to detect a collision between two objects. So it uses bounding boxes.

But there is a class, which detects collisions between two objects based on the actual shapes of them. You can find it from http://code.google.com/p/collisiondetectionkit/
Also a good example from http://www.adventuresinactionscript.com/blog/15-03-2008/actionscript-3-hittestobject-and-pixel-perfect-collision-detection
But remember, hittesting for actual shapes will use more system resources than the hitTestObject function...
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question