Jump to content
Search Community

Bad practice to use tween function in loop event?

ukla test
Moderator Tag

Recommended Posts

Is it bad to use a tweening function in a loop event?

 

I have never had an issue with doing it this way. Just curious to know if it is a bad practice.

 

addEventListener(Event.ENTER_FRAME, loop);
private function loop(e:Event):void
{
    var distx:Number = (mouseX - stage.stageWidth*0.5)/100;
    var disty:Number = (mouseY - stage.stageHeight*0.5)/100;

    TweenMax.to(_currentitem, 1, {rotationX:-disty,ease:Expo.easeOut });

    TweenMax.to(_container, 1, {shortRotation:{rotationY:_roty + distx},ease:Expo.easeOut });
    sortZ();
}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...