home *** CD-ROM | disk | FTP | other *** search
- class com.KidFighting.objects.CItem extends MovieClip
- {
- var area;
- var _twnF;
- var name;
- var breakable = true;
- function CItem()
- {
- super();
- if(this.area != undefined)
- {
- this.hitArea = this.area;
- }
- this.reset();
- this.hide();
- }
- function movBreak()
- {
- if(this.breakable)
- {
- this.breakable = false;
- this._twnF = new ds.transitions.Tween(this,"_currentframe",null,1,this._totalframes,this._totalframes);
- ds.controls.SoundPlayer.playSound("Crashing_" + this.name);
- }
- }
- function reset()
- {
- this.breakable = true;
- this.gotoAndStop(1);
- }
- function fightActivated(evtObj)
- {
- if(this._visible && this.breakable)
- {
- var _loc2_ = evtObj.activer.opponent;
- if(this.hitTest(_loc2_.ani) && (_loc2_.status == "hurt" || _loc2_.status == "thrown" || _loc2_.status == "lose"))
- {
- this.movBreak();
- }
- }
- }
- function show()
- {
- this.reset();
- this._visible = true;
- }
- function hide()
- {
- this._visible = false;
- }
- }
-