Solved

hit test of iregular shapes in actionscript

Posted on 2009-05-03
1
528 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

623 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