home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / animal_artist.swf / scripts / Gamefile / GameStart.as < prev    next >
Encoding:
Text File  |  2008-09-05  |  6.7 KB  |  207 lines

  1. package Gamefile
  2. {
  3.    import flash.display.MovieClip;
  4.    import flash.display.SimpleButton;
  5.    import flash.events.Event;
  6.    import flash.events.MouseEvent;
  7.    import flash.filters.DropShadowFilter;
  8.    import flash.filters.GlowFilter;
  9.    
  10.    public class GameStart
  11.    {
  12.        
  13.       
  14.       private var _hotArea_:SimpleButton;
  15.       
  16.       private var textFilter:GlowFilter;
  17.       
  18.       private var _startBtn_:MovieClip;
  19.       
  20.       private var PARENT:MovieClip;
  21.       
  22.       private var _m_:SimpleButton;
  23.       
  24.       private var _howToPlayBtnText_:MovieClip;
  25.       
  26.       private var shadowFilter:DropShadowFilter;
  27.       
  28.       private var _moreGameBtnText_:MovieClip;
  29.       
  30.       private var _logoMC_:MovieClip;
  31.       
  32.       private var _animalsMC_:MovieClip;
  33.       
  34.       private var _startBtnText_:MovieClip;
  35.       
  36.       private var _nameMC_:MovieClip;
  37.       
  38.       private var _howToPlayBtn_:MovieClip;
  39.       
  40.       private var _moreGameBtn_:MovieClip;
  41.       
  42.       public var _gameStart_:MovieClip;
  43.       
  44.       private var _textMC_:MovieClip;
  45.       
  46.       private var mouseControl:MouseControl;
  47.       
  48.       public function GameStart(param1:MovieClip)
  49.       {
  50.          super();
  51.          initGameStart(param1);
  52.       }
  53.       
  54.       private function moreGameBtnOver(param1:MouseEvent) : *
  55.       {
  56.          btnMouseOver();
  57.          _moreGameBtn_.gotoAndStop(2);
  58.          _moreGameBtnText_.filters = [];
  59.       }
  60.       
  61.       private function startBtnOver(param1:MouseEvent) : *
  62.       {
  63.          btnMouseOver();
  64.          _startBtn_.gotoAndStop(2);
  65.          _startBtnText_.filters = [];
  66.       }
  67.       
  68.       private function howToPlayBtnOver(param1:MouseEvent) : *
  69.       {
  70.          btnMouseOver();
  71.          _howToPlayBtn_.gotoAndStop(2);
  72.          _howToPlayBtnText_.filters = [];
  73.       }
  74.       
  75.       private function initProperty() : *
  76.       {
  77.          textFilter = new GlowFilter(2607607,1,10,10,5,1,false,false);
  78.          shadowFilter = new DropShadowFilter(5,45,51,0.2,7,7,1,1,false,false,false);
  79.          _logoMC_.gotoAndStop(Language.frame_logo);
  80.          _startBtn_.gotoAndStop(1);
  81.          _startBtn_.mouseChildren = false;
  82.          _startBtnText_.gotoAndStop(Language.frame_language);
  83.          _startBtnText_.filters = [textFilter,shadowFilter];
  84.          _howToPlayBtn_.gotoAndStop(1);
  85.          _howToPlayBtn_.mouseChildren = false;
  86.          _howToPlayBtnText_.gotoAndStop(Language.frame_language);
  87.          _howToPlayBtnText_.filters = [textFilter,shadowFilter];
  88.          _moreGameBtn_.gotoAndStop(1);
  89.          _moreGameBtn_.mouseChildren = false;
  90.          _moreGameBtnText_.gotoAndStop(Language.frame_language);
  91.          _moreGameBtnText_.filters = [textFilter,shadowFilter];
  92.       }
  93.       
  94.       private function moreGameBtnOut(param1:MouseEvent) : *
  95.       {
  96.          _moreGameBtn_.gotoAndStop(1);
  97.          _moreGameBtnText_.filters = [textFilter,shadowFilter];
  98.       }
  99.       
  100.       private function btnMouseOver() : *
  101.       {
  102.          SoundsManager.playSound("_MenuMouseOver_");
  103.       }
  104.       
  105.       private function playOver(param1:Event) : *
  106.       {
  107.          if(_textMC_.currentFrame == _textMC_.totalFrames)
  108.          {
  109.             _gameStart_.removeEventListener(Event.ENTER_FRAME,playOver);
  110.          }
  111.       }
  112.       
  113.       private function clickLink(param1:MouseEvent) : *
  114.       {
  115.          Language.onCLick5();
  116.       }
  117.       
  118.       private function showName(param1:MouseEvent) : *
  119.       {
  120.       }
  121.       
  122.       private function delGameStart() : *
  123.       {
  124.          _startBtn_.removeEventListener(MouseEvent.CLICK,showMain);
  125.          PARENT.removeChild(_gameStart_);
  126.       }
  127.       
  128.       private function initElement() : *
  129.       {
  130.          _gameStart_ = new _GameStart_();
  131.          PARENT.addChild(_gameStart_);
  132.          _textMC_ = _gameStart_.getChildByName("TextMC") as MovieClip;
  133.          _startBtn_ = _gameStart_.getChildByName("StartBtn") as MovieClip;
  134.          _startBtnText_ = _startBtn_.getChildByName("TextMC") as MovieClip;
  135.          _howToPlayBtn_ = _gameStart_.getChildByName("HowToPlayBtn") as MovieClip;
  136.          _howToPlayBtnText_ = _howToPlayBtn_.getChildByName("TextMC") as MovieClip;
  137.          _moreGameBtn_ = _gameStart_.getChildByName("MoreGameBtn") as MovieClip;
  138.          _moreGameBtnText_ = _moreGameBtn_.getChildByName("TextMC") as MovieClip;
  139.          _logoMC_ = _gameStart_.getChildByName("LogoMC") as MovieClip;
  140.          _hotArea_ = _logoMC_.getChildByName("hitarea_url1") as SimpleButton;
  141.          _animalsMC_ = _gameStart_.getChildByName("AnimalsMC") as MovieClip;
  142.       }
  143.       
  144.       private function delEvent() : *
  145.       {
  146.       }
  147.       
  148.       private function showMain(param1:MouseEvent) : *
  149.       {
  150.          SoundsManager.playSound("_MenuMouseDown_");
  151.          PARENT.dispatchEvent(new Event("showMain",true));
  152.          _startBtn_.gotoAndStop(3);
  153.          delGameStart();
  154.       }
  155.       
  156.       private function startBtnOut(param1:MouseEvent) : *
  157.       {
  158.          _startBtn_.gotoAndStop(1);
  159.          _startBtnText_.filters = [textFilter,shadowFilter];
  160.       }
  161.       
  162.       private function showHelp(param1:MouseEvent) : *
  163.       {
  164.          SoundsManager.playSound("_MenuMouseDown_");
  165.          PARENT.dispatchEvent(new Event("showMainHelp",true));
  166.          _howToPlayBtn_.gotoAndStop(3);
  167.          delGameStart();
  168.       }
  169.       
  170.       private function initGameStart(param1:MovieClip) : *
  171.       {
  172.          PARENT = param1;
  173.          initElement();
  174.          initEvent();
  175.          initProperty();
  176.       }
  177.       
  178.       private function moreGame(param1:MouseEvent) : *
  179.       {
  180.          _moreGameBtn_.gotoAndStop(3);
  181.          SoundsManager.playSound("_MenuMouseDown_");
  182.          Language.onCLick4();
  183.       }
  184.       
  185.       private function initEvent() : *
  186.       {
  187.          _gameStart_.addEventListener(Event.ENTER_FRAME,playOver);
  188.          _startBtn_.addEventListener(MouseEvent.CLICK,showMain);
  189.          _howToPlayBtn_.addEventListener(MouseEvent.CLICK,showHelp);
  190.          _moreGameBtn_.addEventListener(MouseEvent.CLICK,moreGame);
  191.          _startBtn_.addEventListener(MouseEvent.MOUSE_OVER,startBtnOver);
  192.          _startBtn_.addEventListener(MouseEvent.MOUSE_OUT,startBtnOut);
  193.          _howToPlayBtn_.addEventListener(MouseEvent.MOUSE_OVER,howToPlayBtnOver);
  194.          _howToPlayBtn_.addEventListener(MouseEvent.MOUSE_OUT,howToPlayBtnOut);
  195.          _moreGameBtn_.addEventListener(MouseEvent.MOUSE_OVER,moreGameBtnOver);
  196.          _moreGameBtn_.addEventListener(MouseEvent.MOUSE_OUT,moreGameBtnOut);
  197.          _hotArea_.addEventListener(MouseEvent.CLICK,clickLink);
  198.       }
  199.       
  200.       private function howToPlayBtnOut(param1:MouseEvent) : *
  201.       {
  202.          _howToPlayBtn_.gotoAndStop(1);
  203.          _howToPlayBtnText_.filters = [textFilter,shadowFilter];
  204.       }
  205.    }
  206. }
  207.