# GTween event listeners?

**URL:** <https://forum.kirupa.com/t/gtween-event-listeners/302108>\
**Category:** flash\
**Created:** [December 22, 2009, 12:01am UTC](https://forum.kirupa.com/t/gtween-event-listeners/302108 "2009-12-22T00:01:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohan](https://avatars.discourse-cdn.com/v4/letter/r/f19dbf/32.png) [@rohan](https://forum.kirupa.com/u/rohan)\
**Post date:** [December 22, 2009, 12:01am UTC](https://forum.kirupa.com/t/gtween-event-listeners/302108/1 "2009-12-22T00:01:40Z")

</div>

Hi all,

just started using the GTween library (I used Tweener before) and I really like the idea of having event listeners instead of callbacks.

I’m having a weird problem though, I think I must be missing something. I’ve imported the packages like so

[AS]import com.gskinner.geom._;  
import com.gskinner.motion._; [/AS]

but then if I try to type something as a GTween I get an error

[AS]  
var fadeLoader:GTween = new GTween(\_preloader , 0.5 , {alpha:0});  
fadeLoader.addEventListener(Event.COMPLETE , function(e:Event):void{trace(‘done’)});[/AS]

gives the error

[AS]  
1061: Call to a possibly undefined method addEventListener through a reference with static type com.gskinner.motion:GTween.[/AS]

Am I missing something here? I’m looking at an example on [gskinner.com](http://gskinner.com) and I can’t see any obvious differences

[AS]  
var myTween:GTween = new GTween(mySprite, 2, {x:200});  
myTween.addEventListener(Event.COMPLETE, handleTweenComplete);[/AS]

any help much appreciated!
