7 Replies Latest reply on Aug 6, 2008 2:03 PM by Varangian

# moving image sliding away

Hi....

I managed to make up my mind on using the tweenUpdate effect ... and mess up with the mx.easing stuff....

during the tweenUpdate even I'm checking for collision. Now the question.

How can I make the moving image object slide away from the collided object?

Example Object A is moving towards Object B .... however on the way Object A collides with Object C. I want Object A to slide away from Object C instead of stopping .. how do I think best I can do it? any ideas?

I'm using Flex 3
• ###### 1. moving image sliding away
Did anyone understood the question? please tell me to rephrase the sentences, if no-one understood.
• ###### 2. Re: moving image sliding away
Well you could use another Tween effect to have the object bounce away and come to a gradual stop. To calculate the post-collsion angle (if you want to mimic real physics), you should look into vectors. There are plenty of examples out there to detect collisions and bounced angles.

TS
• ###### 3. Re: moving image sliding away
thanks VarioPegged....
you'r the only one here....

however I don't want bounced angles.... simply slide along the collided object and continue moving...
any ideas?
• ###### 4. Re: moving image sliding away
No problem. Can you post a screen shot of the objects showing arbitrary paths and the expected path when Object A collides with Object C? My understanding of your scenario is that Object A will need to hug the perimeter of Object C as it is sliding along the edge of Object C and at some point continue on its original path beyond Object C. Is that right?

TS
• ###### 5. Re: moving image sliding away
yes exactly!.... described it perfectly and understood exactly what I want..

• ###### 6. Re: moving image sliding away
OK, what you're trying to do is not going to be possible without writing some pretty involved code. I'd suggest you look into the available physics engines for Flash, like ActionScript Physics Engine (APE), Fisix, and others.

TS
• ###### 7. Re: moving image sliding away
ok thanks VarioPegged.....I will