0 Replies Latest reply on Oct 15, 2007 2:03 AM by skeetone

    Video controls not working.

    skeetone
      Hi all,

      I have a bit of a problem and I can't seem to find any solutions. I am pretty new at flash.
      I'm making this magazine using page-flip. On one of the pages there is a little movie playing, but at the moment it starts playing a few pages before you reach the page (page-flip caching need to be a few pages before...otherwise people need to wait on every page). and it won't stop playing when you close the page.

      Like I said I'm very new to this.
      What I have at the moment on that page is a swf file.

      actionscript:

      function onOpen(){
      book.flipOnClickProp = false;
      }

      function onClose(){
      //
      book.flipOnClickProp = true;
      }

      lo = {canPlay: false, videoLoaded: false, page: this};

      lo.progress = function(evt){
      if(evt.target.bytesTotal > 0 && evt.target.bytesLoaded >= evt.target.bytesTotal){
      this.videoLoaded = true;
      if( this.canPlay || this.page.visible ){
      this.canPlay = true;
      evt.target.play();
      text_mc._visible = false;
      }
      }
      }

      lo.complete = function(evt){
      if( this.canPlay ){
      evt.target.stop();
      evt.target.play();
      }
      }


      media.addEventListener("progress", lo);
      media.addEventListener("complete", lo);

      function onOpen(){
      lo.canPlay = true;
      if(lo.videoLoaded) {
      media.play();
      text_mc._visible = true;
      }
      }

      function onClose(){
      lo.canPlay = true;
      if(lo.videoLoaded) {
      media.stop();
      text_mc._visible = true;
      }
      }