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

  1. package dss145_10
  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.             if(gDoneDepart)
  69.             {
  70.                so.data.lastDone = 2;
  71.             }
  72.             else if(gameWon == true)
  73.             {
  74.                so.data.lastDone = 1;
  75.             }
  76.             else
  77.             {
  78.                so.data.lastDone = 0;
  79.             }
  80.             so.flush();
  81.             _engine.host.changeModule({"numMod":0});
  82.          };
  83.          this.BT_RETOUR.activeMC();
  84.       }
  85.       
  86.       public function set _gameWon(param1:Boolean) : void
  87.       {
  88.          this.gameWon = param1;
  89.       }
  90.       
  91.       public function set _gameOn(param1:Boolean) : void
  92.       {
  93.          this.gameOn = param1;
  94.       }
  95.       
  96.       public function get _gameOn() : Boolean
  97.       {
  98.          return this.gameOn;
  99.       }
  100.       
  101.       public function setFunctionHideCursorSpecial(param1:Function) : void
  102.       {
  103.          this.funcHide = param1;
  104.       }
  105.       
  106.       public function setFunctionShowCursorSpecial(param1:Function) : void
  107.       {
  108.          this.funcShow = param1;
  109.       }
  110.       
  111.       public function set visible(param1:Boolean) : void
  112.       {
  113.          this._movie.visible = param1;
  114.       }
  115.       
  116.       public function get visible() : Boolean
  117.       {
  118.          return this._movie.visible;
  119.       }
  120.    }
  121. }
  122.