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

  1. package dss145_12
  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.          this.gDoneDepart = this.gListDone[_engine.config.moduleNum - 1] == 1;
  44.          this.BT_RETOUR = new InteractiveMovie(this._movie,_timelineManager);
  45.          this.BT_RETOUR.gotoAndStop(1);
  46.          this.BT_RETOUR.mc.onRollOver = function(param1:Object):void
  47.          {
  48.             funcHide();
  49.             this.gotoAndStop(2);
  50.             _engine.playNoise(new NoiseObject({"code":"B_RET"}));
  51.             _engine.showIB({
  52.                "id":"IB_RET",
  53.                "reference":_movie
  54.             });
  55.          };
  56.          this.BT_RETOUR.mc.onRollOut = function(param1:Object):void
  57.          {
  58.             funcShow();
  59.             this.gotoAndStop(1);
  60.             _engine.stopNoise(new NoiseObject({"code":"B_RET"}));
  61.             _engine.hideIB();
  62.          };
  63.          this.BT_RETOUR.mc.onPress = function(param1:Object):void
  64.          {
  65.             _engine.hideIB();
  66.             _engine.stopNoise(new NoiseObject({"code":"B_RET"}));
  67.             this.kill();
  68.             var _loc2_:int = 0;
  69.             if(gDoneDepart)
  70.             {
  71.                so.data.lastDone = 2;
  72.             }
  73.             else if(gameWon == true)
  74.             {
  75.                so.data.lastDone = 1;
  76.                _loc2_ = 13;
  77.             }
  78.             else
  79.             {
  80.                so.data.lastDone = 0;
  81.             }
  82.             so.flush();
  83.             _engine.host.changeModule({"numMod":_loc2_});
  84.          };
  85.          this.BT_RETOUR.activeMC();
  86.       }
  87.       
  88.       public function set _gameWon(param1:Boolean) : void
  89.       {
  90.          this.gameWon = param1;
  91.       }
  92.       
  93.       public function set _gameOn(param1:Boolean) : void
  94.       {
  95.          this.gameOn = param1;
  96.       }
  97.       
  98.       public function get _gameOn() : Boolean
  99.       {
  100.          return this.gameOn;
  101.       }
  102.       
  103.       public function setFunctionHideCursorSpecial(param1:Function) : void
  104.       {
  105.          this.funcHide = param1;
  106.       }
  107.       
  108.       public function setFunctionShowCursorSpecial(param1:Function) : void
  109.       {
  110.          this.funcShow = param1;
  111.       }
  112.       
  113.       public function set visible(param1:Boolean) : void
  114.       {
  115.          this._movie.visible = param1;
  116.       }
  117.       
  118.       public function get visible() : Boolean
  119.       {
  120.          return this._movie.visible;
  121.       }
  122.    }
  123. }
  124.