Solved

hit test of iregular shapes in actionscript

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

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 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…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

734 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