Motion Guide + AS3

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?

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!

Similar Messages

  • Motion guide for a mask?

    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 mask
    with AS, but my scripting ability is not -= to the task just yet. I
    have the masks moving straight along _x and _y okay w. script but
    I'd like to be floating them around the stage with more expression.
    thanks
    jg

    veverica wrote:
    > 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
    mask with AS, but my
    > scripting ability is not -= to the task just yet. I have
    the masks moving
    > straight along _x and _y okay w. script but I'd like to
    be floating them around
    > the stage with more expression.
    Convert your mask layer into movie clip than place in on
    timeline to give it the Motion
    Guide. In flash you can't apply two options to single layer,
    either mask or guide, not both.
    Using action script is easy when come to mask but this will
    as well require movie clips
    as you need use movie clip to define the target and the mask.
    Say, motion guide is in movie clip call "guide" and mask in
    movie clip call "mask", all
    you need is place that on timeline frame:
    guide.setMask(mask);
    Best Regards
    Urami
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • How to use imported paths from Photoshop/Illustrator as motion guides

    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's a very specific shape (near enough a square but with curved corners and a chunk missing out of one of the sides), and I used the paths feature in Photoshop to create it and stroke the path for the smoothest possible effect. What I'd ideally like to do is import the same path I used to create the shape into Flash Professional CS6 and then use that same path to guide a small symbol around the edge of the square.
    So far, I've worked out how to apply motion to a symbol through basic tweens, and then I can draw out a line using the pencil tool and apply that to the tween so it follows the pencil line instead of just going from point A to point B. The problem is, this looks awful...I'm not good enough with a mouse to create absolutely perfect shapes freehand, so I just want to be able to use the Photoshop path as my motion guide instead of having to make another one from scratch.
    I've looked around for various importing methods, the most success I've had is exporting the paths to an Illustrator file, and then importing the Illustrator file into Flash directly. However, I have NO idea where these paths go when they're imported, or how to access them. If I import them to the stage, they seemingly disappear before I've even seen them, and if I import them to the library they just aren't there.
    I could also do with a brief description of how paths work in Flash - I'm familiar with the Photoshop layout, what with the paths appearing in a panel next to the layers one (makes perfect sense to me, as you can just switch between the two panels to view whatever you want). I just don't understand how they work in Flash and what I should be looking for....
    Many thanks in advance for any help!
    Todd

    I had a play around with some variations of this. What I can't grasp is why Flash won't recognise my shape layer as a motion path. I've tried breaking it down, that doesn't work... I traced it narrowly in Photoshop and imported it as a thin line with a gap (so essentially a line with two ends), and it comes into Flash as a bitmap or something of that sort. I found an option that traces the bitmap, and appears to convert it into a shape layer...I've managed to find the optimal settings so the line is joined all the way through apart from the start and end points. The only thing is, Flash seems to not even notice this as a guide layer when I apply it to the symbol I'm trying to animate. It just doesn't even notice it's there. The object moves straight from point A to point B in a straight line, the guide layer does nothing to adjust the motion... Is it not possible for the traced line to act as a motion guide? It's a shape, it is a single line with a start point and an end point, and there are no other instances of anything else in the layer - just the line and nothing else.
    This seems way more difficult than it should be...I'm sure Adobe could have integrated a MUCH easier system for importing paths from Photoshop that actually exist in Flash rather than disappearing into some abyss instead!
    Here is a screenshot of what I'm working with: http://gyazo.com/4c1046767e1ee8bf99f65751b9ba81b8
    The long black oval is the shape I'm trying to animate. I've tried applying tweens to it while it's in shape form and while it's in every different symbol form, all to no avail.
    The black line is what I'm trying to use as the guide. Having looked online, people seem to be able to just use the "paste in place" option and it somehow knows exactly what they mean and animates around the line perfectly. I tried that and it didn't work (no surprise there), and then I tried the motion guide layer setup and it also didn't work. I'm not sure if tracing a bitmap into a shape layer somehow removes any possibility of the line being recognisable as a line or something...could that be the case?
    Is there a simple way to turn a shape layer (in this case the black line) into a motion guide that I'm missing? I thought just turning the layer into a guide layer would do the trick, but obviously not :/

  • Help Please:  Modifying a Motion Guide

    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 magnifying
    glass continues along the path, moves to the next area, stops,
    moves on, etc, etc.
    About mid-way through the timeline, I need to remove one of
    the areas along the path the magnifying glass highlights because it
    is no longer an option. I'm assuming this means I need to somehow
    remove that portion of the motion guide and key frames and
    reconnect the dots somehow.
    Any suggestions? It seems when I try to remove the frames, it
    breaks. When I try to modify the motion guide, it breaks.
    So I guess the overall question is, how do you change a
    Motion guide path somewhere in the middle of the timeline without
    breaking the entire thing. Your help and comments are most
    appreciated.
    Regards,
    Stephen

    This is probably the most confusing explanation I've ever heard. Do you have pictures? It sounds like you're trying to make 2 sided shapes. That's not too hard. You just have to separate them in space by 1 unit in z space. Remember, if you're using lighting you need to light both sides.

  • Urgent: How to tween motion guide?

    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 background that I want to scroll from right-left to make it look like the ball is moving.
    I want the path to move at the same speed as the background to so the ball moves along the background
    How can I do that? 
    Here are the project files so you can have a look at what I want. If you could do what I want for me that would be awesome!
    cs5.5
    https://rapidshare.com/files/238332578/PAth.fla
    cs5
    https://rapidshare.com/files/3320417608/PAth5.fla
    cs4
    https://rapidshare.com/files/2435213298/PAth4.fla
    Thanks

    Animating the path will break the timeline tween as you have already seen.  What you need to do is place the entire animation you have now inside a movieclip and tween that movieclip in the opposite direction of the ball motion.  To place it into a movieclip, select all the frames in the timeline, right click and choose copy frames.  Create a new Movieclip symbol, right click the one keyframe in it and choose paste frames.

  • Movie Clip / motion guide

    :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 the clip. The tool in the
    properties dialog box didn't match with my will.
    Thanks for your support.

    josh23gb,
    > Is it possible to attache a movie clip from the library
    to
    > a motion guide and then animate it along that path you
    > set up?
    No. But you can attach an empty movie clip to a motion guide
    by hand,
    then attach your Library asset to the empty clip.
    David
    stiller (at) quip (dot) net
    Dev essays:
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • How to use circle as a motion guide

    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 - select a tiny
    portion of the strok and delete it
    (breaking the circle) then just motion tween from one end of
    the stroke to the other.
    --> **Adobe Certified Expert**
    --> www.mudbubble.com
    --> www.keyframer.com
    Walter Elias wrote:
    > Best way I know is to divide the tween in half. Put a
    keyframe half-way
    > through, then place the object on the other side of the
    circle. If you're
    > careful about placement, it will move to the opposite
    side, then move back to
    > the starting point.
    >
    > For a smooth motion, on the last part of the tween, add
    a keyframe just before
    > the final frame. Then delete the final frame. Because
    the original final frame
    > is identical to the first frame, when the movie loops,
    it would appear to pause
    > for two frames. So by deleting the final frame, instead
    when the movie loops,
    > it appears to have a smooth motion.
    >

  • Copy/Paste Frames in New Layer Un-Synching from Guide

    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 necessary, insert a new key frame, and repeat this action over many layers. In all my previous Flash version experience (think back to Flash 4 I've been doing this), the animation pastes perfectly into the new empty layer. This allows me to fill a street map of roads with arrows down a stretch of road that repeat perfectly over a 8 frame animation.
    What's different is in CS4, once I paste in the animation into the new layer, it un-synchs from the motion guide. I then have to manually re-synch, or attach, it to the guide.
    I need for this NOT to happen. Is there a setting or preference some where I am not seeing that prevents the un-synching from happening? I don't understand why CS4 would be different in this regard to the previous versions of Flash I've had experience with.
    Thanks for your time.

    A friend who has worked for me in Flash doing what I do and is now in school has informed me that guides in CS4 are no longer used, that they want you to use motion tweens instead, so the guides are difficult to use now, and as she put it "They found a better way to do motion so they want you to use the new way". She also informed me that this not the case in CS3, and that you can save your CS4 file as a CS3 file and use the guides normally without buggy behavior.
    She also confirmed that what I do in Flash can't be done, or rather is just grossly ineffective and time consuming, with motion tweens.
    If Adobe is reading this, I for one would sincerely appreciate it if you un-did the buggy behavior of guides, and reinstate the code in CS4 to allow us to continue using guides normally.
    Thank you.

  • Combining a path motion tween with a mask

    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 bottom-most layer.  above that layer create a while shape that covers you black shape.  above that layer create your oval and tween it.  finally right click the oval containing layer and click mask.  test.

  • Motion Guild Help

    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 using Flash 8

    I don't know how much you know about motion paths, so I'll
    suggest you go to Flash help (F1 in Flash) and search for "Tween
    Motion along a path". After reading that, post a more specific
    question.
    Once you create a motion guide and the motion tween, you will
    see a checkbox in the Properties Window at the bottom left that
    says "Orient to path". When you click this box, your object will
    follow the path and always point 'nose first' as it moves along.
    Hope this helps.

  • How do you create a looped 'conveyor belt' effect with objects on a motion path?

    I am trying to efficiently create the following looped
    effect: a bunch of shapes constantly following a motion guide (a
    closed circle). Basically the object could be a conveyor belt or
    something else.
    http://i75.photobucket.com/albums/i302/Cablestein/dfg.jpg
    I want to avoid having to do it the old-fashioned way of
    multiplate layers and symbols. I do not want to see the triangles
    skip or jitter while moving along either.
    Is there an obvious way to do this with action script? Some
    way to simply start with a single symbol and motion guide, then
    applying some script (copy-paste).

    Thanks.
    A circle is easy enough, sure, but I would like to make all
    kinds of curves in that circle actually. Everyone knows about
    rotating a basic circle. This is beyond that. Imagine all kinds of
    turns, waves and spirals in that line.
    I have tried Illustrator, and there's potential solutions
    there... like the text-on-path tool (why doesn't Flash have that
    yet?) which works fantastic. Still a lot of manual work, and will
    be a ton of manually copied frames. I wanted something more
    efficient.

  • How do I make buttons work?

    I am taking a college course which includes learning some
    things about Dreamweaver/Flash, but the text I have is 3
    generations behind the current software. I am trying to make a
    start and stop button...it's not working. I have the symbols
    created, the start/stop text put there, and the Buttons layer
    created above my motion guide layer (with the motion guide nested).
    My instructions tell me to go to:
    Windows
    Actions
    Actions Folder (not there in the newer software)
    Movie Control
    Play - double click
    Stop - double click
    At this point I'm supposed to be able to close out of the
    Actions pane and play/stop the movie using the buttons.
    As I said these instructions are very old - how do I
    accomplish this in the newer software? I assume there is a simple
    way and I'm just not seeing it:-)
    Thanks for your help...

    first you need to determine which programming language you
    want to use AS2 or AS3 - since the syntax is different to handle
    mouse event (ie - a click) - then 'today' we usually create a new
    layer called 'actions' and place code within frames in that layer.
    so you would select the first frame and then open the actions panel
    and place your button's code -
    if using AS2:
    play_btn.onPress = function() {
    play();
    stop_btn.onPress = function() {
    stop();
    however if you've decided to use AS3:
    function playMovie(event:MouseEvent) {
    play();
    function stopMovie(event:MouseEvent) {
    stop();
    play_btn.addEventListener(MouseEvent.CLICK, playMovie);
    stop_btn.addEventListener(MouseEvent.CLICK, stopMovie);
    in both cases another thing you need to do is give the
    buttons 'instance names' - do this by selecting one on the Stage
    and looking in the properties panel - you will see the box for the
    instance name - type a name for the button, and then use that name
    in code when referring to that object. (eg - play_btn,
    stop_btn)

  • Flash CS4 Tween Migration

    Hi,
    I just wanted to get the thoughts of the expert here. I played around with the new tween tool in CS4, and it seems that the difference is I dont see the tween arrow anymore in the timeline; and there is an easing in the property that has been added. How this has changed from the old concept finally?
    I see this just like putting some icing on the cake, and nothing would wow me to use this tool.
    Please correct me if I am wrong, especially those of you who have utilized this tool in a different manner.
    Looking forward for an open discussions.
    Thank you
    uxk

    Hi Uxk,
    I'm actually glad that you're finding the workflow similar - because it's actually a rather massive two-cycling change behind the scenes, and we typically hear something a bit different. Here are some of the changes and benfits between old and new:
    you cannot break a new motion tween - no more “dashed arrows”
    as such, new tweens are easier to use: you directly manipulate objects on the Stage without needing to always think about keyframes. You don’t even need to add keyframes - just manipulate the object and the keyframes are inserted for you.
    granular control over each part of a tween.
    motion paths are shown right on the Stage for all tweens. Highly visual, and directly editable.
    you can use the new Motion Editor with new tweens
    as such, the Motion Editor means tweens are more powerful in general: each property and keyframe on each property is accessible and editable independently. You can tween alpha separately from rotation separately from scale (etc).
    in that Motion Editor you can edit individual properties on a graph
    you can use the new 3D model with new tweens
    you can give your tween an instance name and then give other instances that same tween at runtime
    new tweens are easy to stretch by just dragging the span in the timeline
    new tweens have new eases, which have advanced (and very cool, better, enhanced) eases
    you can create/apply custom eases that do not need to end at 100%
    you can save a tween as a preset and reuse it in that or other documents
    new tweens are easy to move now - either on the timeline (drag the tween span around), or on the stage by selecting the motion path and just moving it on the Stage (lets just say it is WAY easier than edit multiple frames).
    motion paths in general are easier, and you no longer need motion guides. The motion path for a tween is attached right to the tween.
    you can apply a new instance to an existing tween by just pasting it onto a tween to swap it out, drag a new instance from the Library, or use Swap Symbol. you can even have a tween without an instance applied to it, and all properties of that tween will be saved until you apply an instance to it.
    (From my blog post here: http://flashthusiast.com/2008/09/22/the-new-way-of-tweening-in-flash-cs4-or-new-motion-in- flash-cs4-makes-your-animations-better-faster-stronger/)
    You may want to check out the Motion Migration guide here: http://www.adobe.com/devnet/flash/articles/motion_migration_guide.html  -- this article outlines the changes between the two models.
    Some of the bigger new features to check out are: Motion Presets (pre-made and custom), the Motion Editor (it ain't small...), preset eases (these made a radical difference in how quickly I could do certain animations), and tween instances (tons of new capabilities here, and reductions in amt of scripted code you have to write). Here are some blog posts on them:
    Tween instances:
    http://flashthusiast.com/2008/12/10/flash-cs4-example-spray-brush-tween-instance-new-motio n-as3-fancy-jsfl-profit/
    http://flashthusiast.com/2008/10/12/new-motion-and-tween-instances-flash-cs4-presentation- flashcamp/
    Motion editor and custom eases:
    http://flashthusiast.com/2008/11/20/flash-cs4-modifying-and-applying-a-custom-ease-in-the- motion-editor/
    You may also want to adapt how you use F6 with tweens:
    http://flashthusiast.com/2009/01/09/flash-cs4-using-f6-with-new-motion-tweens/
    Entire Animation guide:
    http://www.adobe.com/devnet/flash/learning_guide/animation/
    Let me know if you have any questions,
    Jen.

  • Simple orient to path what's wrong ?

    Hi,
    Flash CS5
    Do I need to keyframe a car following a straight line at both ends of the straight line then have another at the end of the curve ? three kf's in total ?
    Why isn’t orient to path and a kf at either end enough to keep the car dead straight until the line bends ?
    Heres the simple task.
    Set fps to 60.
    draw a horizontal line then bend the end down. This will be the route the car follows.
    Draw a rectangle to represent plan view of a car and convert to Symbol (MotionClip)
    Snap it to the line at frame 1, and then add a keyframe at fr170, move the car to the end of the curved line for fr170 and snap to the end, rotate the block to orient to the path at that area.
    Create a motion tween, test movie, it starts to turn and become the angled car immediately it runs, as expected.
    Create a classic motion guide for the car layer, cut and paste the line using ‘Paste In Place’ to this layer at fr1 and add a keyframe at fr170. Just to be sure move and resnap car at both ends of line.
    Select a frame in the tween of the car layer and in properties select orient to path.
    Run movie, still it starts to turn immediately. Should not orient to path keep it on the straight course until the line turns ?
    Envirographics

    I don't know what the laws and regulations are in Europe so I can't tell you if it entitles you to an exchange or not.  Here is the US it would as long as you were within the stores return period (normally 7 to 14 days).  After that it would be up to the store to decide if they would exchange it or if you would have to send it in for repair under warranty.  That's one of the reasons why posting here in the USA forums isn't a very good idea for people from other countries. 
    As for support, I can only tell you that here in the USA OFFICIAL support tends to be fairly poor.  I only have a Toshiba laptop because I won it as a door prize at a store opening.  Otherwise I would never have purchased one and have tried to sell this one, but no one has been foolish enough to purchase it so I could get something better.
    If you don't post your COMPLETE model number it's very difficult to assist you. Please try to post in complete sentences with punctuation, capitals, and correct spelling. Toshiba does NOT provide any direct support in these forums. All support is User to User in their spare time.

  • When I create a new mailbox in mail.app, the mailbox does not appear in the list of mailboxes

    I am trying to create a new mailbox in mail.app, but it never appears in the list of mailboxes. This USED TO WORK.

    Without seeing anything of what you did there is not much to go on except to say that when you create a classic tween you use a library-based object and it has to exist at both ends of the tween.  When motion guides come into play you usually have to fiddle around when making the link between the object and the motion guide to get the object to lock to it.

Maybe you are looking for

  • How do I convert an MP4 file to an aac file

    i have converted some online videos to MP4 files. They are in my iTunes home movies folder but I can't hear them in my music play list. How do I make this happen? Do they need converting to aac files?

  • Where do I find the download-link for "Adobe Design Std 5.5"?

    Hi. I wanna download the Adobe Design Std 5.5 on my new computer. I already deactivited it on my old computer. But now I'm desperatly searching a download-link to get the Adobe Design for my new computer. thanks for helping!!

  • I need to do some work in Arabic language...

    Hi I need to do some work in Arabic language... Write text in Arabic language into a food product label I use Google translator for translation But when I copy and paste into illustrator cs4 which I use now Then the Arabic text comes the wrong way Do

  • Clarifications in picklist output type EK00 for transaction VL02N

    Hi evryone,                   Can anyone please help me to generate a smartform for picklist output type EK00 for Tcode VL02N. In application V2 the standard program is  RVADEK01 and the form SD_PICK_SINGLE,           what is the best way to create s

  • Cursor location on jTextBox

    Hi, I need to know How can I reference the current location of the write cursor in a jTextBox or jTextArea so that I can for example select the two chars that are before the cursor, or insert some words in the place the cursor is located... Any help?