Jump to content
Search Community

is this possible

Koschi test
Moderator Tag

Recommended Posts

hi,

 

i was browsing this page/project the whole day and i can just say that it this is amazing.

 

Now 1 question that appears for me is the following.

 

Is it possible to tween an movie clip in an special way. I don't really have an endpoint for it. Just an direction in degrees and the speed it should move.

Now i want the movie clip to move from its starting point to the direction in the defined speed for an set amount of time like 5 seconds. Afterwards it

should launch an event if it does not hit another movie clip.

 

Don´t worry about the hit test thing, i was just wondering if that moving is possible with your/this engine?

 

thanks for answers.

 

with kind regards

Link to comment
Share on other sites

Sure, that's exactly what the physics2D plugin is for. See an interactive example in the Plugin Explorer - the example actually shows a bunch of balls being spewed upwards at random velocities and angles and then it applies a gravity force to them. It's a rather interesting effect but you don't have to do all the fancy stuff. You could simply do:

 

TweenLite.to(mc, 5, {physics2D:{angle:0, velocity:10}});

 

The Physics2DPlugin is a membership benefit of Club GreenSock ("Really Green" and above), so it's not in the public downloads.

 

If you only want a simple velocity effect, you could also just do the math yourself and not use physics2D:

 

var velocity:Number = 10;
var duration:Number = 5;
var destinationX:Number = mc.x + velocity * duration;
TweenLite.to(mc, duration, {x:destinationX, ease:Linear.easeNone});

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...