Solved

hit test of iregular shapes in actionscript

Posted on 2009-05-03
1
512 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to how to record live broadcast.

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now