[Tweener] init many mcs in as3 at once using this keyword?

david jhave johnston jhave2 at gmail.com
Tue Dec 11 21:01:28 PST 2007


Hi

I am continuing to bump my head against walls in AS3.
How is it possible to init many mcs with same set of tweening behaviors?
Passing 'this' inside tweener now does not reference the calling object....

//this AS3 code does not work because "this" is wrong....
this.menu_mc.addEventListener ('mouseOver', function() {
       Tweener.addTween(this, {scaleX:1.02,scaleY:1.02, time:0.2});
});

All help appreciated. Sorry if its a mildly trivial question
I just missthe ease with which many mcs could be assigned similar tweens....

see example below, thanks
jhave

//example : in AS2 to init many mcs to similar behavior was possible like
this:
var mcs="husserl,rilke,gendlin,maturana,tao,james,putnam,artaud,jhave"
_root.mcsAr=mcs.split(",")
for(i=0;i<_root.mcsAr.length;i++){
   var mc =    _root[_root.mcsAr[i]+"_mc"]
    //
    mc.onRollOver=function(){
        // fade in using this as reference to mc....
        this.tween("_alpha",100,0.3)
    }
    mc.onRollOut=function(){
        //
        this.tween("_alpha",10,0.3)
    }
    mc.onRelease=function(){
        //
       this.tween("_alpha",50,0.3)
    }
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.caurinauebi.com/pipermail/tweener-caurinauebi.com/attachments/20071211/1b329c66/attachment.htm 


More information about the Tweener mailing list