if you make a new instance of TweenMax you have to calls its .play method to trigger it
On Mon, Apr 5, 2010 at 1:40 PM, Mendelsohn, Michael < [email protected]> wrote: > Hi list... > > I'm trying to call a function twice in a row, and have some TweenMax > instances fire up. They aren't firing. I thought it would have to do with > the way I'm instancing the TweenMax objects, instead of calling the static > "to" method, but that doesn't seem to be it. I still suspect that instances > are somehow cancelling each other out. Example 2 works, and they're > instance with the static "to" method. But, the issue is, I'd like to reduce > the amount of code I have down to one private function. > > Any advice is appreciated, > - Michael M. > > // not working, TweenMax doesn't get fired at all... > /////////////////////////////////////// > > enable(buttonBack, .2, .9, 2, false); > enable(buttonNext, 1, 1, 0, true); > > private function enable(t:Sprite, a:Number, s:Number, b:Number, > e:Boolean):void{ > var tween1 = new TweenMax(t.getChildAt(0), .5, {alpha:a, scaleX:s, > scaleY:s, blurFilter:{blurX:b,blurY:b,quality:2}, ease:Sine.easeOut}); > var tween2 = new TweenMax(t.getChildAt(1), .5, {alpha:a, scaleX:s, > scaleY:s, blurFilter:{blurX:b,blurY:b,quality:2}, ease:Sine.easeOut}); > t.buttonMode = e; > var addOrRemove:String = > (e==true)?"addEventListener":"removeEventListener"; > t[addOrRemove](MouseEvent.CLICK, dispatchProceedEvent); > var v:Boolean = > (t==buttonBackEnabled)?buttonBackEnabled:buttonNextEnabled; > v = e; > } > > // this works all instances of TweenMax fire properly... > /////////////////////////////////////// > > TweenMax.to(buttonBack.getChildAt(0), .5, {alpha:.2, scaleX:.9, scaleY:.9, > blurFilter:{blurX:2,blurY:2,quality:2}, ease:Sine.easeOut}); > TweenMax.to(buttonBack.getChildAt(1), .5, {alpha:.2, scaleX:.9, scaleY:.9, > blurFilter:{blurX:2,blurY:2,quality:2}, ease:Sine.easeOut}); > buttonBack.buttonMode = false; > buttonBack.removeEventListener(MouseEvent.CLICK, dispatchProceedEvent); > buttonBackEnabled = false; > TweenMax.to(buttonNext.getChildAt(0), .5, {alpha:1, scaleX:1, scaleY:1, > blurFilter:{blurX:0,blurY:0,quality:2}, ease:Sine.easeOut}); > TweenMax.to(buttonNext.getChildAt(1), .5, {alpha:1, scaleX:1, scaleY:1, > blurFilter:{blurX:0,blurY:0,quality:2}, ease:Sine.easeOut}); > buttonNext.buttonMode = true; > buttonNext.addEventListener(MouseEvent.CLICK, dispatchProceedEvent); > buttonNextEnabled = true; > > _______________________________________________ > Flashcoders mailing list > [email protected] > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

