home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 145 / MOBICLIC145.ISO / pc / DATA / DSS145 / DSS145_07 / DSS145_07.swf / scripts / dss145_07 / BtRetour.as < prev    next >
Text File  |  2012-07-18  |  4KB  |  125 lines

  1. package dss145_07
  2. {
  3.    import com.milanpresse.engine.Engine;
  4.    import com.milanpresse.engine.initmovieclip.InteractiveMovie;
  5.    import com.milanpresse.engine.managers.TimelineManager;
  6.    import com.milanpresse.engine.medias.MediaSwf;
  7.    import com.milanpresse.engine.typeargument.NoiseObject;
  8.    import flash.display.MovieClip;
  9.    import flash.net.SharedObject;
  10.    
  11.    public class BtRetour
  12.    {
  13.        
  14.       
  15.       private var BT_RETOUR:InteractiveMovie;
  16.       
  17.       private var gListDone:Array;
  18.       
  19.       private var gDoneDepart:Boolean;
  20.       
  21.       private var gameWon:Boolean = false;
  22.       
  23.       private var gameOn:Boolean = false;
  24.       
  25.       private var funcHide:Function;
  26.       
  27.       private var funcShow:Function;
  28.       
  29.       private var _movie:MovieClip;
  30.       
  31.       public function BtRetour(param1:Engine, param2:TimelineManager, param3:SharedObject)
  32.       {
  33.          var _engine:Engine = param1;
  34.          var _timelineManager:TimelineManager = param2;
  35.          var so:SharedObject = param3;
  36.          super();
  37.          var BT_RETOURswf:MediaSwf = _engine.showSwf({
  38.             "code":"BT_RETOUR",
  39.             "parent":_engine.config.layers["menu"]
  40.          });
  41.          this._movie = BT_RETOURswf.swfContent;
  42.          this.gListDone = so.data.listDone;
  43.          if(this.gListDone != null)
  44.          {
  45.             this.gDoneDepart = this.gListDone[_engine.config.moduleNum - 1] == 1;
  46.          }
  47.          this.BT_RETOUR = new InteractiveMovie(this._movie,_timelineManager);
  48.          this.BT_RETOUR.gotoAndStop(1);
  49.          this.BT_RETOUR.mc.onRollOver = function(param1:Object):void
  50.          {
  51.             funcHide();
  52.             this.gotoAndStop(2);
  53.             _engine.playNoise(new NoiseObject({"code":"B_RET"}));
  54.             _engine.showIB({
  55.                "id":"IB_RET",
  56.                "reference":_movie
  57.             });
  58.          };
  59.          this.BT_RETOUR.mc.onRollOut = function(param1:Object):void
  60.          {
  61.             funcShow();
  62.             this.gotoAndStop(1);
  63.             _engine.stopNoise(new NoiseObject({"code":"B_RET"}));
  64.             _engine.hideIB();
  65.          };
  66.          this.BT_RETOUR.mc.onPress = function(param1:Object):void
  67.          {
  68.             _engine.hideIB();
  69.             _engine.stopNoise(new NoiseObject({"code":"B_RET"}));
  70.             this.kill();
  71.             if(gDoneDepart)
  72.             {
  73.                so.data.lastDone = 2;
  74.             }
  75.             else if(gameWon == true)
  76.             {
  77.                so.data.lastDone = 1;
  78.             }
  79.             else
  80.             {
  81.                so.data.lastDone = 0;
  82.             }
  83.             so.flush();
  84.             _engine.host.changeModule({"numMod":0});
  85.          };
  86.          this.BT_RETOUR.activeMC();
  87.       }
  88.       
  89.       public function set _gameWon(param1:Boolean) : void
  90.       {
  91.          this.gameWon = param1;
  92.       }
  93.       
  94.       public function set _gameOn(param1:Boolean) : void
  95.       {
  96.          this.gameOn = param1;
  97.       }
  98.       
  99.       public function get _gameOn() : Boolean
  100.       {
  101.          return this.gameOn;
  102.       }
  103.       
  104.       public function setFunctionHideCursorSpecial(param1:Function) : void
  105.       {
  106.          this.funcHide = param1;
  107.       }
  108.       
  109.       public function setFunctionShowCursorSpecial(param1:Function) : void
  110.       {
  111.          this.funcShow = param1;
  112.       }
  113.       
  114.       public function set visible(param1:Boolean) : void
  115.       {
  116.          this._movie.visible = param1;
  117.       }
  118.       
  119.       public function get visible() : Boolean
  120.       {
  121.          return this._movie.visible;
  122.       }
  123.    }
  124. }
  125.