home *** CD-ROM | disk | FTP | other *** search
/ PC Open 96 / PC Open 96 CD3.bin / fscommand / index.swf / scripts / frame_1 / DoAction.as < prev   
Encoding:
Text File  |  2004-01-08  |  2.3 KB  |  73 lines

  1. _global.FPS = 15;
  2. this.initPlay = function(fileType)
  3. {
  4.    this.VIDEO_NAVIGATION.setEnabled(true);
  5.    this.VIDEO_NAVIGATION.start();
  6.    if(fileType == "MP3" && !this.MUSIC)
  7.    {
  8.       this.attachMovie("MUSIC","MUSIC",++this.depth);
  9.       this.MUSIC._x = this.VIDEO._x;
  10.       this.MUSIC._y = this.VIDEO._y;
  11.    }
  12.    if(fileType == "JPEG")
  13.    {
  14.       this.bt_POSITION_SLIDER._visible = false;
  15.    }
  16.    else
  17.    {
  18.       this.bt_POSITION_SLIDER._visible = true;
  19.    }
  20. };
  21. this.loadVideo = function(video, fileType)
  22. {
  23.    var arr;
  24.    var index;
  25.    if(this.VIDEO.getBytesTotal() != null && this.VIDEO.getBytesTotal() != 0 && this.VIDEO.getBytesTotal() < 100 || this.VIDEO.getBytesLoaded() < this.VIDEO.getBytesTotal())
  26.    {
  27.       return undefined;
  28.    }
  29.    if(this.VIDEO)
  30.    {
  31.       this.VIDEO.unloadMovie();
  32.       this.VIDEO.removeMovieClip();
  33.    }
  34.    this.VIDEO = this.createEmptyMovieClip("VIDEO",++this.depth);
  35.    this.VIDEO._x = 218;
  36.    this.VIDEO._y = 47;
  37.    this.VIDEO_NAVIGATION.register("VIDEO",this.VIDEO);
  38.    this.VIDEO_NAVIGATION.register("PLAY",this.bt_PLAY);
  39.    this.VIDEO_NAVIGATION.register("PAUSE",this.bt_PAUSE);
  40.    this.VIDEO_NAVIGATION.register("REWIND",this.bt_REWIND);
  41.    this.VIDEO_NAVIGATION.register("FORWARD",this.bt_FORWARD);
  42.    this.VIDEO_NAVIGATION.register("MUTE",bt_MUTE);
  43.    this.VIDEO_NAVIGATION.register("VOLUME_SLIDER",bt_VOLUME_SLIDER);
  44.    this.VIDEO_NAVIGATION.register("VOLUME_SLIDER_BAR",bt_VOLUME_SLIDER_BAR);
  45.    this.VIDEO_NAVIGATION.register("POSITION_SLIDER",bt_POSITION_SLIDER);
  46.    this.VIDEO_NAVIGATION.register("POSITION_SLIDER_BAR",bt_POSITION_SLIDER_BAR);
  47.    if(!this.LOADING)
  48.    {
  49.       this.attachMovie("LOADING","LOADING",++this.depth);
  50.       this.LOADING._x = this.VIDEO._x;
  51.       this.LOADING._y = this.VIDEO._y;
  52.    }
  53.    if(this.MUSIC)
  54.    {
  55.       this.MUSIC.removeMovieClip();
  56.    }
  57.    this.VIDEO.loadMovie(video);
  58.    this.loadingInterval = setInterval(this,"onLoadingInterval",20,fileType);
  59. };
  60. this.onLoadingInterval = function(fileType)
  61. {
  62.    if(!(this.VIDEO.getBytesTotal() > 100000 && this.VIDEO.getBytesLoaded() > 100000))
  63.    {
  64.       if(this.VIDEO.getBytesTotal() < 100 || this.VIDEO.getBytesLoaded() < this.VIDEO.getBytesTotal())
  65.       {
  66.          return undefined;
  67.       }
  68.    }
  69.    this.LOADING.removeMovieClip();
  70.    this.initPlay(fileType);
  71.    clearInterval(this.loadingInterval);
  72. };
  73.