Smoother Tween alternative to ENTER_FRAME function???

By Woodsy01 | Jul 5, 2009

actionscript3

I’ve got a tween which is called using an ENTER_FRAME event listener. However, the tween isn’t very smooth, it’s very jumpy and I’m guessing this has got something to do with the ENTER_FRAME event being constantly called.

Is there a better way of creating a smoother tween?

Here’s my code…

ActionScript Code:
this.addEventListener(Event.ENTER_FRAME, ballFloat); private function ballFloat(event:Event):void         {                 var myTweenX:Tween = new Tween(this, “x”, Regular.easeOut, this.x, randomXBoundary, 10, true);                        TweenX = myTweenX;         }// end of ballFloat function

actionscript3

Please reply at our Forum

1 Comment so far
  1. Gaurav Goel August 12, 2009 6:41 am

    Try - updateAfterEvent();

    Change your method as below -

    private function ballFloat(event:Event):void
    {
    event.updateAfterEvent();
    var myTweenX:Tween = new Tween(this, “x”, Regular.easeOut, this.x, randomXBoundary, 10, true);
    TweenX = myTweenX;
    }// end of ballFloat function

Leave a Comment

If you would like to make a comment, please fill out the form below.

Name (required)

Email (required)

Website

Comments

© 2007 ActionScript 3.0