Current Position:Home > Motion Guide + AS3

Motion Guide + AS3

Update:11-30Source: network consolidation
Advertisement
I'm designing a game in which a player rides a bike around a
track. The game needs to show a "lap indicator" that displays the
player's progress along an irregularly-shaped course.
I'm guessing the best way to do this will be to copy the
layer that has the course outline and use that as a Motion Guide,
then move the indicator along that guide? Should I use the
flash.motion.Animator class to do this?
I also would really like to have the position indicator
"turn" as it goes along the route, i.e. a triangle that always
points in the direction of travel. I think I can do it like this:
* determine the indicator's x and y before moving it,
* moving to the next frame,
* finding the new x and y,
* then figure out which direction it moved horizontally and
vertically, the ratio between the two, then convert this to a
rotation angle. So if it moved to right horizontally, but didn't
move vertically, that's 90 degrees; if it moved equally down and
left that's 225 degrees, etc.
Or is there an easier way to do this?

The Best Answer

Advertisement
OK, it seems I was a bit confused, "orient to path" is what
I'm looking for here. I thought that option merely indicated that
the object should use the motion guide, but it actually rotates it
to "look where it's going" instead. Perfect!
  • Motion Guide + AS3 Update:11-30

    I'm designing a game in which a player rides a bike around a track. The game needs to show a "lap indicator" that displays the player's progress along an irregularly-shaped course. I'm guessing the best way to do this will be to copy the layer t

  • Motion guide for a mask? Update:11-30

    Am I missing something obvious or is it not possible to apply a motion guide layer (with a path) to a mask (mc or graphic instance) or masked object? Any suggestions are greatly appreciated. Of course the ideal way around this would be to move the ma

  • How to use imported paths from Photoshop/Illustrator as motion guides Update:11-30

    Hi folks, I've been raking the internet with no success for an answer to my question, but I've had no luck so far. What I'm hoping to achieve animation wise is to have a shape move around a set path that was created in Photoshop. The reason being, it

  • Help Please:  Modifying a Motion Guide Update:11-30

    I have a flash application that moves a magnifying glass along a motion guide to highlight various aspects of a template. As it moves through, it stops at various (keyframe) portions of the template until the user clicks the next button, then the mag

  • Urgent: How to tween motion guide? Update:11-30

    Hi, Basically, I have this motion guide set up with a ball on it. The ball travels along the motion guide as I want, but I need the motion guide to move as well. When I tween the motion guide, the ball no longer moves across the guide. I have a backg

  • Movie Clip / motion guide Update:11-30

    :music; I'd like to say if Action Script would be used in a movie clip lied on a motion guide? e.g. : Slowing down a movie clip during the elapsed whole time onto the motion guide. When I used code like mclip_x -= 50; It didn't affect the speed of th

  • How to use circle as a motion guide Update:10-11

    I want to motion tween an object along a perfect closed circle but struggle to tell Flash to use the full circle. Instead it does only use the shortest way (just rattling the object a bit). Any help?best way i know is, after making the circle - selec

  • Copy/Paste Frames in New Layer Un-Synching from Guide Update:10-11

    I recently upgraded to CS4 from Flash MX 2004, and I'm experiencing a problem with something I've literally been doing for years in Flash. What I do is copy/paste keyframed animation from one layer into a new empty layer. I then trim the animation as

  • Combining a path motion tween with a mask Update:11-30

    I have a mask layer that I have animated and underneath that I have a motion tween of a symbol using a path motion guide. The mask doesn't seem to work with those layers. Is that a restriction? If so BIG BIG BUMMER!!create a black shape in your botto

  • Motion Guild Help Update:11-30

    I know how to create a motion guide path for a movie clip to move along, but I'm lost. :/ I would like to know how a could make the object(s) front face the way its going. That way you could do something, oh, i don't know, a driving car. P.s( I'm usi