Jump to content
Search Community

Red_21

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by Red_21

  1. 
    Hello everyone, I started to study TweenMax in AS3 environment.
    I have 2 buttons, each button launches its animation.
    When I press 1 button then animation 1 starts and it will work all the time even if I press 2 button.
    Question: How can I stop animation when I call another animation?
    
    Sorry for the English, I know him very badly.
    
     
    [Embed(source = "image/anim1.png")] var Anim1:Class;
    [Embed(source = "image/anim2.png")] var Anim2:Class;
    var anim1 = new Anim1();
    anim1.x = 1070;
    anim1.y = 284;
    anim1cont.addChild(anim1);
    var anim2 = new Anim2();
    anim2.x = 1070;
    anim2.y = 284;
    anim2cont.addChild(anim2);
    
    cont.addChild(anim1cont);
    cont.addChild(anim2cont);
    addChild(cont);	
    
    private function button1(event:MouseEvent):void { 
    			removeEventListener(Event.ENTER_FRAME,  button1)
     			TweenMax.to(anim1cont, 6, {y:-10,x:-320, repeat:-1});
    			}
    private function botton2(event:MouseEvent):void
    		{
    			removeEventListener(Event.ENTER_FRAME,  button2)
     			TweenMax.to(anim2cont, 6, {y:-10,x:-320, repeat:-1});
    		}

     

    project1.rar

×
×
  • Create New...