1 Reply Latest reply on Dec 13, 2013 2:39 PM by .:}x-=V!P=-x{:.

    Writing Action Script 3 to activate buttons

    Sarntzy

      I created an  interactive battlefield map for a class project this semester. I did it in Adobe Flash Professional. When I went to activate the buttons (a scroll at the beginning that people can click on to play the movie, and a timeline that has a button that scrolls across with the video). With the scroll in the beginning, I couldn't figure out the appropriate script to stop the video before it played, then visitors can click on the scroll to play the movie. I've used "gotoAndPlay" but it doesn't stop at the scroll, it just continues playing the video. I then tried "gotoAndStop" where it stops at the scroll, but won't continue playing when you click on it.

       

      That's the first problem, the second is the timeline button. The ball that flows across the video is meant to be clicked on at any time when the viewer wants to stop playing the video. I've tried the same scripts but it doesn't do any good. I need a script that plays the ball with the video but when it is clicked on, it needs to stop.

       

      Any suggestions, please?

        • 1. Re: Writing Action Script 3 to activate buttons
          .:}x-=V!P=-x{:. Level 3

          if you are using the FLVvideo component you can use inside your button function a conditional check

          replace "instanceName" with your component instance name

           

          if(instanceName.VideoState = "VideoState.PLAYING") {

              instanceName.stop();

          } else {

               instanceName.play();

          }

           

          if you imported the video to a timeline then youd need different code for you button

          1 person found this helpful