home *** CD-ROM | disk | FTP | other *** search
/ Ice Age Fan CD 1 / CD1_Scrat.iso / flash / data / game.swf / scripts / asCode / introHowToPlayScreenClass.as < prev    next >
Encoding:
Text File  |  2012-07-04  |  2.3 KB  |  81 lines

  1. package asCode
  2. {
  3.    import com.adamsearle.events.TrackingEvent;
  4.    import com.terry.Broadcaster;
  5.    import flash.display.*;
  6.    import flash.events.*;
  7.    
  8.    public class introHowToPlayScreenClass extends MovieClip
  9.    {
  10.       public var helpNavBtnLeft:helpNavBtnClip;
  11.       
  12.       public var introHelpPlayBtn:helpPlayBtnClip;
  13.       
  14.       public var helpNavBtnRight:helpNavBtnClip;
  15.       
  16.       private var currentHelpPage:int = 1;
  17.       
  18.       public function introHowToPlayScreenClass()
  19.       {
  20.          super();
  21.          helpNavBtnLeft.addEventListener(MouseEvent.CLICK,mouseDownHandler);
  22.          helpNavBtnRight.addEventListener(MouseEvent.CLICK,mouseDownHandler);
  23.          helpNavBtnLeft.buttonMode = true;
  24.          helpNavBtnRight.buttonMode = true;
  25.          evalButtons();
  26.       }
  27.       
  28.       private function mouseDownHandler(param1:MouseEvent) : void
  29.       {
  30.          switch(param1.target.name)
  31.          {
  32.             case "helpNavBtnRight":
  33.                ++currentHelpPage;
  34.                if(currentHelpPage > 2)
  35.                {
  36.                   currentHelpPage = 3;
  37.                }
  38.                evalButtons();
  39.                break;
  40.             case "helpNavBtnLeft":
  41.                --currentHelpPage;
  42.                if(currentHelpPage < 1)
  43.                {
  44.                   currentHelpPage = 1;
  45.                }
  46.                evalButtons();
  47.          }
  48.       }
  49.       
  50.       private function evalButtons() : void
  51.       {
  52.          this.gotoAndStop(currentHelpPage);
  53.          var _loc1_:Object = new Object();
  54.          _loc1_.name3 = "how_to_play_page";
  55.          _loc1_.name4 = currentHelpPage;
  56.          Broadcaster.dispatchEvent(new TrackingEvent(TrackingEvent.TRACK_EVENT,_loc1_));
  57.          if(currentHelpPage < 2)
  58.          {
  59.             helpNavBtnLeft.alpha = 0.2;
  60.             helpNavBtnLeft.buttonMode = false;
  61.          }
  62.          else
  63.          {
  64.             helpNavBtnLeft.alpha = 1;
  65.             helpNavBtnLeft.buttonMode = true;
  66.          }
  67.          if(currentHelpPage > 2)
  68.          {
  69.             helpNavBtnRight.alpha = 0.2;
  70.             helpNavBtnRight.buttonMode = false;
  71.          }
  72.          else
  73.          {
  74.             helpNavBtnRight.buttonMode = true;
  75.             helpNavBtnRight.alpha = 1;
  76.          }
  77.       }
  78.    }
  79. }
  80.  
  81.