home *** CD-ROM | disk | FTP | other *** search
- class com.KidFighting.SelectCharacterGUI extends MovieClip
- {
- static var addEventListener;
- static var _mc;
- static var dispatchEvent;
- static var _evt = mx.events.EventDispatcher.initialize(com.KidFighting.SelectCharacterGUI);
- static var delay_timer = new ds.controls.Timer();
- static var selected_char_id = -1;
- static var selected_enemy_id = -1;
- function SelectCharacterGUI()
- {
- super();
- com.KidFighting.SelectCharacterGUI._mc = this;
- com.KidFighting.SelectCharacterGUI.delay_timer.func = mx.utils.Delegate.create(com.KidFighting.SelectCharacterGUI,com.KidFighting.SelectCharacterGUI.onSelectedEnemy);
- com.KidFighting.SelectCharacterGUI.delay_timer.interval = 4000;
- }
- static function reset()
- {
- var _loc1_ = com.KidFighting.SelectCharacterGUI._mc;
- com.KidFighting.SelectCharacterGUI.selected_char_id = -1;
- com.KidFighting.SelectCharacterGUI.selected_enemy_id = -1;
- _loc1_._visible = true;
- _loc1_.gotoAndStop(1);
- com.KidFighting.SelectCharacterGUI._mc.c1.gotoAndStop(2);
- _loc1_.s1.onRelease = function()
- {
- com.KidFighting.SelectCharacterGUI.selected_char_id = 0;
- com.KidFighting.SelectCharacterGUI.selectPlayer();
- ds.controls.SoundPlayer.playSound("vSelectCharector");
- };
- _loc1_.s2.onRelease = function()
- {
- com.KidFighting.SelectCharacterGUI.selected_char_id = 1;
- com.KidFighting.SelectCharacterGUI.selectPlayer();
- ds.controls.SoundPlayer.playSound("vSelectCharector");
- };
- _loc1_.s1.onRollOver = function()
- {
- com.KidFighting.SelectCharacterGUI._mc.c1.gotoAndStop(2);
- com.KidFighting.SelectCharacterGUI._mc.c2.gotoAndStop(1);
- if(com.KidFighting.SelectCharacterGUI._mc.c2.getDepth() > com.KidFighting.SelectCharacterGUI._mc.c1.getDepth())
- {
- ds.controls.SoundPlayer.playSound("charectorOn");
- com.KidFighting.SelectCharacterGUI._mc.c2.swapDepths(com.KidFighting.SelectCharacterGUI._mc.c1);
- }
- };
- _loc1_.s2.onRollOver = function()
- {
- com.KidFighting.SelectCharacterGUI._mc.c1.gotoAndStop(1);
- com.KidFighting.SelectCharacterGUI._mc.c2.gotoAndStop(2);
- if(com.KidFighting.SelectCharacterGUI._mc.c2.getDepth() < com.KidFighting.SelectCharacterGUI._mc.c1.getDepth())
- {
- com.KidFighting.SelectCharacterGUI._mc.c2.swapDepths(com.KidFighting.SelectCharacterGUI._mc.c1);
- ds.controls.SoundPlayer.playSound("charectorOn");
- }
- };
- }
- static function selectPlayer()
- {
- com.KidFighting.SelectCharacterGUI._mc.gotoAndStop(2);
- com.KidFighting.SelectCharacterGUI._mc.p1.gotoAndStop(com.KidFighting.SelectCharacterGUI.selected_char_id + 1);
- com.KidFighting.SelectCharacterGUI._mc.p1Name_txt.gotoAndStop(com.KidFighting.SelectCharacterGUI.selected_char_id + 1);
- com.KidFighting.SelectCharacterGUI.dispatchEvent({type:"selectPlayer",id:com.KidFighting.SelectCharacterGUI.selected_char_id});
- com.KidFighting.SelectCharacterGUI.selectNextPlayer();
- }
- static function selectNextPlayer()
- {
- if(com.KidFighting.SelectCharacterGUI.selected_enemy_id != -1)
- {
- if(com.KidFighting.SelectCharacterGUI.selected_enemy_id < 6)
- {
- com.KidFighting.SelectCharacterGUI._mc.avator_mc["a" + (com.KidFighting.SelectCharacterGUI.selected_enemy_id + 1)].gotoAndStop(2);
- }
- else
- {
- com.KidFighting.SelectCharacterGUI._mc.avator_mc["a" + (com.KidFighting.SelectCharacterGUI.selected_enemy_id + 1)].gotoAndStop(3);
- }
- }
- com.KidFighting.SelectCharacterGUI.selected_enemy_id = com.KidFighting.SelectCharacterGUI.selected_enemy_id + 1;
- if(com.KidFighting.SelectCharacterGUI.selected_enemy_id > 5)
- {
- com.KidFighting.SelectCharacterGUI._mc.avator_mc["a" + (com.KidFighting.SelectCharacterGUI.selected_enemy_id + 1)].gotoAndStop(2);
- }
- com.KidFighting.SelectCharacterGUI._mc.p2.gotoAndStop(3 + com.KidFighting.SelectCharacterGUI.selected_enemy_id);
- com.KidFighting.SelectCharacterGUI._mc.p2Name_txt.gotoAndStop(3 + com.KidFighting.SelectCharacterGUI.selected_enemy_id);
- com.KidFighting.SelectCharacterGUI._mc._visible = true;
- com.KidFighting.SelectCharacterGUI._mc.avator_mc.gotoAndPlay(2);
- com.KidFighting.SelectCharacterGUI.delay_timer.start();
- }
- static function onSelectedEnemy()
- {
- com.KidFighting.SelectCharacterGUI.delay_timer.stop();
- com.KidFighting.SelectCharacterGUI.dispatchEvent({type:"selectEnemy",id:com.KidFighting.SelectCharacterGUI.selected_enemy_id});
- com.KidFighting.SelectCharacterGUI._mc._visible = false;
- }
- static function onRoundCleared()
- {
- com.KidFighting.SelectCharacterGUI.selectNextPlayer();
- }
- }
-