greensock / GreenSock-AS3

Public repository for GreenSock's ActionScript 3 libraries like GSAP (TweenLite, TweenMax, etc.) and LoaderMax. For AS2, see the GreenSock-AS2 repository and for JavaScript, see the GreenSock-JS repository. Main site: http://www.greensock.com
409 stars 144 forks source link

ticker does not update #5

Closed glacialspring closed 11 years ago

glacialspring commented 11 years ago

I had trouble making the ticker work, both from TweenLite and Animation classes. TweenLite.to() works fine however. The function is just never called.

I tested it in an a new, pure AS3 mobile project in FlashDevelop. I'm using AIR sdk 3.7 with FlashDevelop 4.4.2 Tested basic code:

circle = new Sprite(); circle.graphics.beginFill(0xff0000); circle.graphics.drawCircle(0, 0, 100); circle.graphics.endFill(); addChild(circle); TweenLite.ticker.addEventListener("tick", tick);

private function tick(event:Event):void { trace("tick"); circle.x += 2; circle.y += 2; }

glacialspring commented 11 years ago

By the way, I just downloaded the newest from this repo and it is still true.

jackdoyle commented 11 years ago

All you need to do is create one tween to instantiate the engine. It can be a zero-duration tween of an empty object like TweenLite.to({}, 0, {}) or a delayedCall() to a dummy function. Just one, and then it'll dispatch tick events normally.

hellogavin commented 11 years ago

I compile this code in Flash builder 4.7 will be error in " TweenLite.ticker.addEventListener("tick", tick);" and I check its API cannot find ticker.

jackdoyle commented 11 years ago

hellogavin, it sounds like maybe you're using a very old version of TweenLite (version 11.x or earlier instead of 12.x). The ticker was introduced in v12.