3 Replies Latest reply on Sep 18, 2007 1:47 PM by kitster79

    Button Problem!

    kitster79 Level 1
      I have just upgraded to Flash CS3 and I'm having problems with attaching Actionscript to just a button!:)

      I'm probably just missing something really obvious but can anyone suggest why it is not letting me?

      Thanks

      Kit
        • 1. Re: Button Problem!
          Level 7

          AS3 deals with it more verbose, but more standard too. AS3 does not
          allow attaching script to objects. Script can only be placed in the
          timeline or in external script files.

          Either use AS2 settings or take a look at eventhandlers and the
          addEventListener() method in particular. (look for addEventlistener in
          the helpfiles and the third item has a good example)

          HTH,
          Manno

          kitster79 wrote:
          > I have just upgraded to Flash CS3 and I'm having problems with attaching
          > Actionscript to just a button!:)
          >
          > I'm probably just missing something really obvious but can anyone suggest why
          > it is not letting me?
          >
          > Thanks
          >
          > Kit
          >


          --
          ----------
          Manno Bult
          http://www.aloft.nl
          • 2. Re: Button Problem!
            Ardy15jan
            Well, AS3 doesn`t support attaching code to a MovieClip or Button directly on an instance. So if you tryed to do that, it won`t work. You can only add Actionscript to frames(at least that`s what I understood after checking out the help documentation, Actionscript migration - if I`m wrong, and anyone knows if this is possible and how it`s done, please post).
            There is a new system for event listening(check out the help menu). There`s no more MovieClip.onMouseDown = function(){}, now event listening is done by means of addEventListener(<event type>, <event handler function>). So, if you want to add some event handlers for a button, try the following code:

            • 3. Re: Button Problem!
              kitster79 Level 1
              Thank you very much!