3 Replies Latest reply on Jun 19, 2007 6:09 AM by Newsgroup_User

    Apply Actionscript to Objects

    Nuzler
      Hey,
      I've just downloaded the trial version of Adobe Flash CS3, and I'm having trouble adding actions to my objects. Once I've selected the object the message "Current selection cannot have actions applied to it" is shown in the actions panel. I'm sure that in previous versions of flash you were able to add actions to movie clip objects. So what is it that I have to do different in this version?


      Many thanks

      Nuzler
        • 1. Re: Apply Actionscript to Objects
          Level 7
          Nuzler,

          > I've just downloaded the trial version of Adobe Flash CS3,
          > and I'm having trouble adding actions to my objects.

          Bingo. This is due to the version of ActionScript you're using.
          ActionScript 3.0 does not support the direct application of code to objects.
          It's for this reason that the Behaviors panel is dimmed when the publish
          settings are configured for AS3.

          >Once I've selected the object the message "Current selection
          > cannot have actions applied to it" is shown in the actions
          > panel.

          That's it.

          > I'm sure that in previous versions of flash you were able to
          > add actions to movie clip objects. So what is it that I have
          > to do different in this version?

          You've got two options: a) give your objects instance names (see the
          Property inspector) and reference their names from timeline (or external)
          scripts, or b) change the publish settings for your document to sometimes
          besides ActionScript 3.0.


          David Stiller
          Adobe Community Expert
          Dev blog, http://www.quip.net/blog/
          "Luck is the residue of good design."


          • 2. Apply Actionscript to Objects
            Nuzler Level 1
            Ahh I see. Thanks for that, it was really doing my head in not being able to do something as simple as making a button!

            edit: Yeah, brilliant. I've changed it to Actionscrip 2.0 and it works perfectly. Thanks a lot!
            • 3. Re: Apply Actionscript to Objects
              Level 7
              Nuzler,

              > Ahh I see. Thanks for that, it was really doing my head
              > in not being able to do something as simple as making a
              > button!

              I hear ya. :) Be aware, of course, that buttons are perfectly doable
              even without on() or onClipEvent(). Depending on the complexity of your
              project, you may even find it easier to go with the newer approach (new
              since Flash MX [aka 6]).

              Here's a bit more detail:

              http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


              David Stiller
              Adobe Community Expert
              Dev blog, http://www.quip.net/blog/
              "Luck is the residue of good design."