Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Help with CS4 motion tween loop

New Here ,
Jan 21, 2010 Jan 21, 2010

I am a newbie to flash and only know some simple stuff. I would appreciate some help please

I am trying to create a horizontal scrolling movie in Flash CS4

I have made my movie clip, created a simple classic motion tween and it works just fine.

However my problem is that when it reaches the end and 'jumps' back to the beginning it is a very abrupt jump.

Is there any way in ActionScript to make that jump smooth. Do I have to stop the movie at the end and then transition it to the start again somehow.

Thanks

Kathryn

TOPICS
ActionScript
3.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 21, 2010 Jan 21, 2010

In what way do you mean to have a jump smoothed?  What do you really want to have happen?

What you might want to try instead of using a classic tween is to use an Actionscript Tween (ot two).  I'm not sure if this is what you're after, but the code below makes a movieclip named "mc" move back and forth.  Just open a new file for demo purposes, created a movieclip on the stage and give it an instance name of "mc".  Then create an actions layer and play this code in the first frame...

import fl.transitions.Tween;
import fl.transitions.TweenEvent;

 

function tweenOut(evt:TweenEvent=null):void{
      var tweenX:Tween = new Tween(mc, "x", null, mc.x, 200, 4, true);// tween out
      tweenX.addEventListener(TweenEvent.MOTION_FINISH, tweenIn);
}

 

function tweenIn(evt:TweenEvent=null):void{
      var tweenX:Tween = new Tween(mc, "x", null, mc.x, 0, 4, true);// tween out
      tweenX.addEventListener(TweenEvent.MOTION_FINISH, tweenOut);
}

 

tweenOut();

If you look up the Tween class in the help documents and look thru the constructor section, it explains what all the arguments are in the Tween function call.  For instance, to speed up the return trip, that 4 means 4 seconds, so you could reduce that.  And that null in the middle is usually an easing function that can provide effects such as gradually slowing or rubberbanding type stuff.  I just used null to keep it steady.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 21, 2010 Jan 21, 2010

Ned

This is the link to the page I am talking about. When it gets to the 5th image it 'jumps' abruptly to the beginning

http://www.colorsplashes.com/penandprint/index.html

I want it to just be a smooth loop really.

I will try what you suggest and let you know.

Thanks a ton

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 21, 2010 Jan 21, 2010
LATEST

What I provided isn't going to do what you expect/want.  For the approach you have now, what you can do is repeat the first image at the end such that the current last image transitions into showing the first image, then make the jump back to the start.

There are actionscript solutions to what you've done, but if you solve it with what you have now you'll be at the right end of your learning curve for Flash.

There are things you can do to try to smooth out the tweening you have now, such as upping the frame rate and adding more frames in each tween, and you could try to set the images to allow smoothing. (Right click one in the library and select -> Properties -> Allow Smoothing)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines