home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 164 / MOBICLIC164.ISO / pc / DATA / HOTE / libs / VideoBox / VideoBox.swf / scripts / frame_1 / DoAction.as
Text File  |  2014-05-13  |  2KB  |  102 lines

  1. _global._VideoBox_ = this;
  2. this.ETAT = "STOP";
  3. this.Ouvrir = function(p)
  4. {
  5.    xlisteObj(p);
  6.    this.swapDepths(21000);
  7.    this.AfficherVideo(p);
  8. };
  9. this.Fermer = function()
  10. {
  11.    trace("Fermer");
  12.    this._visible = false;
  13.    this.stream_ns.seek(0);
  14.    this.swapDepths(this.Depth);
  15.    this.stream_ns.close();
  16.    this.ETAT = "STOP";
  17. };
  18. this.Pause = function()
  19. {
  20.    this.stream_ns.pause(true);
  21.    this.ETAT = "PAUSE";
  22. };
  23. this.Play = function()
  24. {
  25.    this.stream_ns.pause(false);
  26.    this.ETAT = "PLAY";
  27. };
  28. this.Stop = function()
  29. {
  30.    this.stream_ns.pause(true);
  31.    Go(0);
  32.    this.ETAT = "STOP";
  33. };
  34. this.Go = function(temps)
  35. {
  36.    this.stream_ns.seek(temps);
  37. };
  38. this.AfficherVideo = function(p)
  39. {
  40.    trace("AFFICHER AIDE");
  41.    var params = p;
  42.    this.ECRAN._visible = true;
  43.    var _loc0_ = null;
  44.    var _loc5_ = this.connection_nc = new NetConnection();
  45.    _loc5_.connect(null);
  46.    var _loc0_ = null;
  47.    var _loc2_ = this.stream_ns = new NetStream(_loc5_);
  48.    this.ECRAN.attachVideo(_loc2_);
  49.    _loc2_.setBufferTime(2);
  50.    this.VideoPath = p.path;
  51.    _loc2_.play(this.VideoPath);
  52.    this.ETAT = "PLAY";
  53.    _loc2_.seek(0);
  54.    this._visible = true;
  55.    _loc2_.onMetaData = function(infoObject)
  56.    {
  57.       for(var _loc2_ in infoObject)
  58.       {
  59.          if(_loc2_ == "duration")
  60.          {
  61.             Duration = infoObject[_loc2_];
  62.          }
  63.       }
  64.    };
  65.    _loc2_.onStatus = function(infoObject)
  66.    {
  67.       if(infoObject.code == "NetStream.Play.Stop")
  68.       {
  69.          Fini();
  70.       }
  71.       if(params.width != undefined)
  72.       {
  73.          ECRAN._width = params.width;
  74.          ECRAN._height = params.height;
  75.          ECRAN._x = params.x;
  76.          ECRAN._y = params.y;
  77.       }
  78.       else
  79.       {
  80.          ECRAN._width = ECRAN.width;
  81.          ECRAN._height = ECRAN.height;
  82.          ECRAN._x = Width / 2 - ECRAN.width / 2;
  83.          ECRAN._y = Height / 2 - ECRAN.height / 2;
  84.       }
  85.       for(var _loc2_ in infoObject)
  86.       {
  87.          trace("\t" + _loc2_ + ":\t" + infoObject[_loc2_]);
  88.       }
  89.    };
  90. };
  91. this.Width = this._width;
  92. this.Height = this._height;
  93. this.ECRAN = this.VideoBox.ECRAN;
  94. this.ECRAN.smoothing = true;
  95. this.Depth = this.getDepth();
  96. this.Duration = 0;
  97. this.Fini = function()
  98. {
  99.    trace("Fini()");
  100.    this.ETAT = "STOP";
  101. };
  102.