Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Fitchett Developments

Is replacing Enter_Frame Event listener with Greensock Faster?

Recommended Posts

Hey everyone so I am moving a Movie Clip across the stage using Animate CC/AS3 and I was wondering which way is faster or if it even matters?

 

The initial method I would use was straight forward using an ENTER_FRAME Event Listener like so

addEventListener(Event.ENTER_FRAME, platformLoop);
private function platformLoop(e:Event):void 
		{
			this.x -= 8.0;
		}

the Second Method which i am currently using now is like so:

 

private function init():void 
		{
			TweenLite.delayedCall(0.001, moveChar);
		}
		
		private function moveChar():void 
		{
			TweenLite.delayedCall(0.001, moveChar);
			this.x -= 8.5;
		}

This method using Greensock works just fine and moves the player across the screen pretty smooth. But I was thinking does it even matter is one faster or more efficient than the other?

Share this post


Link to post
Share on other sites

From what I can tell there would be no benefit to using your second method. Calling a function every 1000th of a second isn't going to get you more visual updates than ENTER_FRAME. 

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×