• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1133
  • Last Modified:

Actionscript AS3 tween movieclip on guide

I'm writing in as3.
I want to tween a movieclip along a guide. I have the guide drawn out and made into a guide layer. I have the movieclip linked to the layer beneath it. I want to tween the movieclip via actionscript so I can ease it, and also because it's smoother.

How can I make the movieclip move along the guides? I've snapped it to the guide, but it just moves in a straight line.

Here is the code:
import fl.transitions.Tween;
import fl.transitions.easing.*;
var ball1:Tween = new Tween(tape_mc, "x", Strong.easeOut, 0, 1000, 3, true);

Open in new window

  • 4
  • 2
2 Solutions
here is a good resourse...


click on the "using actionscript 3" heading
crittle1Author Commented:
would this tutorial also apply to CS3?
I know there are better features in CS4 and I want to be sure before I jump in.
crittle1Author Commented:
Thanks for the link, I looked at the page and yes I can apply some of it to CS3.
Unfortunately, they use keyframes to make the motion tween and I don't want to do this because the animation is choppy.
I want to create the motion tween via actionscript, then attach it to a guide on the stage but I don't know how to connect the two.

Any other ideas?
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

crittle1Author Commented:

Anyone know if I can do this or not?
The only way i can think to do this is with CS3 compatibility is..

Create the animation and convert to symbol.
Now use actionscript to tween the 'frame' property of your movieclip.

Only certain tween engines allow you to tween frames. One such engine is greensocks' tweenLite.

I used the following code snippet and it works fine, however you need to set-up class paths to the downloaded classe.

see the attached .swf for proof (remove .txt)
here i used the bounce effect with motion guides.

If you want the .fla let me know.

import gs.TweenLite;
import gs.easing.*
var a1:Anim1 = new Anim1();
TweenLite.to(a1, 2,{frame:100, ease:gs.easing.Bounce.easeOut});

Open in new window

crittle1Author Commented:
Thanks for the responses. I went ahead and tweened via a motion guide and the tween class. Took longer, but I ended up with the results I wanted. I will check into the greensocks' tweenLite. Thanks!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now