forked from: Tween24.pauseAllTweens
forked from Tween24.pauseAllTweens (diff: 11)
ActionScript3 source code
/**
* Copyright ProjectNya ( http://wonderfl.net/user/ProjectNya )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/sD8j
*/
// forked from yozamurai's Tween24.pauseAllTweens
package {
import flash.display.*;
import flash.events.*;
import a24.tween.*;
public class FlashTest extends Sprite {
private var _tw:Tween24;
private var _box:MovieClip = new MovieClip();
public function FlashTest() {
// write as3 code here..
_box.graphics.beginFill(0xFF0000);
_box.graphics.drawRect(0,0,100,100);
addChild(_box);
_tw = Tween24.tween(_box, 4).y(200);
_tw.play();
_box.addEventListener(MouseEvent.CLICK , pauseAll);
}
private function pauseAll(e:MouseEvent):void{
_box.removeEventListener(MouseEvent.CLICK , pauseAll);
_box.addEventListener(MouseEvent.CLICK , play);
Tween24.pauseAllTweens().play();
}
private function play(e:MouseEvent):void {
_box.removeEventListener(MouseEvent.CLICK , play);
_box.addEventListener(MouseEvent.CLICK , pauseAll);
_tw.play();
}
}
}