5 Replies Latest reply on Jul 29, 2009 6:45 AM by marlonrasta

    Still image over video then plays video

    marlonrasta

      Hi people

       

      What I'm trying to do is have a still image act as a button on top of a video, so that when it is pressed the image disappears and the video begins. I've placed the image and video on two seperate layers and typed the action script into the images layer.

       

      I get no errors, however when I preview my site the moment I press the image everything on the site disappears yet I can hear the audio of the video playing.

       

      Any help at all would be greatly appreciated as I'm new at this.

       

      The code I've used is as follows:

       


      import fl.video.VideoEvent;

       

       

       

      function doPlayVid(e:MouseEvent):void {

       

      tanmov.play();

       

      this.alpha = 0;

       

      }

       

       

       

      function doStopped(e:VideoEvent):void {

       

      tanbtn.alpha = 1;

       

      }

       

       

       

      function doPlaying(e:VideoEvent):void {

       

      tanbtn.alpha = 0;

       

      }

       

       

       

      tanbtn.addEventListener(MouseEvent.CLICK,doPlayVid);

       

      tanmov.addEventListener(VideoEvent.STOPPED_STATE_ENTERED,doStopped);

       

      tanmov.addEventListener(VideoEvent.PLAYING_STATE_ENTERED,doPlaying);