Jump to content
Search Community

Search the Community

Showing results for tags 'oncomplete'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GreenSock Forums
    • GSAP
    • Banner Animation
    • Jobs & Freelance
  • Flash / ActionScript Archive
    • GSAP (Flash)
    • Loading (Flash)
    • TransformManager (Flash)

Product Groups

  • Club GreenSock
  • TransformManager
  • Supercharge

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Personal Website


Twitter


CodePen


Company Website


Location


Interests

  1. I have some code that scrolls a movieClip. The problem is I cannot get the onComplete to fire and remove the listener. It will fire when the clip reaches its bounds but not any time in between. Does my code prevent the tween from completing? import com.greensock.*; import flash.display.MovieClip; var mc:Sprite = new Sprite(); mc.graphics.beginGradientFill(GradientType.LINEAR, [0x666666,0xfff000],[0.9,0.1],[0,255], new Matrix(0,-1,1,0,height,0)); mc.graphics.drawRect(225, 50, 100, 300) addChild(mc); var destination:Point=new Point(); var dragging:Boolean=false; var speed:Number=20; var offset:Point=new Point(); var topLimit:Number = 0 - ( mc.height - (stage.height-50) ); var bottomLimit:Number = 120; mc.addEventListener(MouseEvent.MOUSE_DOWN,startdrag, false, 0, true); stage.addEventListener(MouseEvent.MOUSE_UP,stopdrag, false, 0, true); function startdrag(e:MouseEvent):void{ offset.y=mc.mouseY*mc.scaleY; dragging=true; mc.addEventListener(Event.ENTER_FRAME,followmouse, false, 0, true); } function stopdrag(e:MouseEvent):void{ dragging=false; } function followmouse(e:Event):void{ if(dragging){ destination.y=mouseY; } TweenLite.to(mc, 2, {y:mc.y-=(mc.y-(destination.y-offset.y))/speed, onComplete:removeEFListener}); if(mc.y > bottomLimit){ mc.removeEventListener(Event.ENTER_FRAME,followmouse); TweenLite.to(mc, .6, {y:bottomLimit}); trace('removedBottom'); } if(mc.y<topLimit){ TweenLite.to(mc, .6, {y:topLimit}); mc.removeEventListener(Event.ENTER_FRAME,followmouse); trace('removedTop'); } } function removeEFListener():void{ mc.removeEventListener(Event.ENTER_FRAME,followmouse); trace('removedEL'); } Note: This code is repurposed. I lost the source for the original code and gladly give credit where its due - so if its yours, thanks and good job.
  2. Howdy! Have a problem and was wondering if there was a quick solution... Is there a way to remove all 'onComplete' events? Here is my scenario: - I create and start tweens on movieClips with onComplete events. TweenLite.to(waveMc, 5, {alpha:0, ease:Sine.easeInOut, delay:2, overwrite:false, onComplete:showNextWave} ); function showNextWave() { trace("Still gets called?"); } - Then user initated cancel (halfway through the animation)... need to remove all movieClips - I'm using teh following to remove the movieClip: while (this.numChildren != 0) { this.removeChildAt(0); } It seems that the onComplete event still gets triggered. Is there a way to make sure the tweens and events also get destroyed?
×
×
  • Create New...