1 Reply Latest reply on May 10, 2008 2:35 PM by clbeech

    How do I make buttons work?

    Lost-in-CS3 Level 1
      I am taking a college course which includes learning some things about Dreamweaver/Flash, but the text I have is 3 generations behind the current software. I am trying to make a start and stop button...it's not working. I have the symbols created, the start/stop text put there, and the Buttons layer created above my motion guide layer (with the motion guide nested).

      My instructions tell me to go to:
      Windows
      Actions
      Actions Folder (not there in the newer software)
      Movie Control
      Play - double click
      Stop - double click

      At this point I'm supposed to be able to close out of the Actions pane and play/stop the movie using the buttons.

      As I said these instructions are very old - how do I accomplish this in the newer software? I assume there is a simple way and I'm just not seeing it:-)

      Thanks for your help...
        • 1. Re: How do I make buttons work?
          clbeech Level 3
          first you need to determine which programming language you want to use AS2 or AS3 - since the syntax is different to handle mouse event (ie - a click) - then 'today' we usually create a new layer called 'actions' and place code within frames in that layer. so you would select the first frame and then open the actions panel and place your button's code -

          if using AS2:

          play_btn.onPress = function() {
          play();
          }

          stop_btn.onPress = function() {
          stop();
          }

          however if you've decided to use AS3:

          function playMovie(event:MouseEvent) {
          play();
          }
          function stopMovie(event:MouseEvent) {
          stop();
          }
          play_btn.addEventListener(MouseEvent.CLICK, playMovie);
          stop_btn.addEventListener(MouseEvent.CLICK, stopMovie);

          in both cases another thing you need to do is give the buttons 'instance names' - do this by selecting one on the Stage and looking in the properties panel - you will see the box for the instance name - type a name for the button, and then use that name in code when referring to that object. (eg - play_btn, stop_btn)