Skip to main content
August 6, 2009
Question

How can I apply onComplete to GTweener (gskinner) ?

  • August 6, 2009
  • 1 reply
  • 1075 views

Hi,

I am trying to add an onComplete with staticRate to the (gskinners) GTween in an attempt to Optimization the SWF Framerate similar to what Lee Brimelow has done in the following project (http://www.gotoandlearn.com/play?id=112) . My action script is below.

- PS

Please let me know if this make sense ... maybe I am asking the question incorrectly.

Thank You for your help.


public function staticRate():void{
stage.frameRate=5;
}

public function animationRate():void {
stage.frameRate=30;
}

private function onClick(e:MouseEvent):void {
trace("BUTTON: SINGLE CLICKED");
animationRate();
var tw:GTween=new GTween(container,0.8,{rotationY:Math2.toDeg(e.curr entTarget.angle+Math.PI/2),z:100},{ease:Exponential.easeInOut,delay:0.1});

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
August 6, 2009

I am not familiar with GTween, but based on a little Googling you can try the following...

tw.addEventListener(Event.COMPLETE, handleComplete);

function handleComplete(e:Event):void {

     //whatever

}

August 6, 2009

Hi Ned,

Thank You for your help. I actually went to gkinner.com (http://gskinner.com/blog/archives/2008/08/gtween_a_new_tw.html) and got the same answer you gave me and it worked. So you were right on with your answer.

Thanks Again,

Ned Murphy
Legend
August 6, 2009

You're welcome.