/** * @class BoutonOnOff * @tooltip No description available. * @author Thomas * @version 0.3 */ import mx.utils.Delegate; dynamic class as.cla.BoutonOnOff { // properties: var _obj : MovieClip; var _targ : MovieClip; public var _step : Number; //constructor: public function BoutonOnOff (pObj, pTarg) { _targ = pTarg; _targ._visible = false; _obj = pObj; _step = 0; _obj.onRelease = Delegate.create (this , release ); } // methods: private function release () { _targ._visible = ! _targ._visible; if (_step == 0) { _obj.play (); _step = 1; } else { _obj.gotoAndStop (1) _step = 0; } } public function get step () { return _step; } }