Jump to content
Search Community

Is there a way to move a clip when it is hit by another clip

learner_7n test
Moderator Tag

Recommended Posts

Collision detection is not part of the GreenSock Tweening Platform.

 

There are a variety of ways to detect when 2 objects collide. AS3 display objects have hitTestObject() and hitTestPoint(). some people have created their own code for even more advanced pixel perfect collision detection.

 

Try googling "as3 collision detection" there is much out there.

 

I would start here: http://www.foundation-flash.com/tutoria ... ittesting/

 

using their example simply add your tween code where "ouch" is displayed

 

if (circle.hitTestObject(square)) {
			hittext.text = "Ouch!";

//do a TweenLite tween here


		} else {
			hittext.text = "";
		}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...