3 Replies Latest reply on Oct 19, 2007 9:02 AM by NickTheNameless

    transition tutorial for as 3.0?

    NickTheNameless
      so i started my first completely new, from the ground up project since the release of 3.0. i'm a dork, so i was kinda excited to create a new fla file and save 3.0 in the publish settings. so then i got about my business, create a movie clip that i want to use as a button, jump into my actions panel, and give that movie clip instance onRelease, onRollOver, and onRollOut functions. SHABAM!!! spot, we're not in the bahamas any more....

      needless to say, 3.0 doesn't work like that. so i tried to fix it from the compiler errors, i needed to create an eventListener. alright, i know how to do that. SHABAM!!! it got aggravating really quick, so then i try to find some documentation to guide me, but i'm finding it hard to find information basically with the idea of "i used to do this, so now what do i do?" anyone know of a tutorial that might help me?
        • 1. Re: transition tutorial for as 3.0?
          Level 7
          Hi --

          It is a litte more complicated in AS 3.0 but you have to add event
          listeners, as you said. I create all of my objects programatically and add
          event listeners to them.

          Here is a sample button with an event listener:

          var downButton:Button = new Button();

          downButton.label = "down";
          downButton.addEventListener(ComponentEvent.BUTTON_DOWN, buttonDownHandler);
          addChild(downButton)

          function buttonDownHandler(event:ComponentEvent) {
          trace('inside the function')
          }


          Rich


          "NickTheNameless" <webforumsuser@macromedia.com> wrote in message
          news:ff8k3n$pd7$1@forums.macromedia.com...
          > so i started my first completely new, from the ground up project since the
          > release of 3.0. i'm a dork, so i was kinda excited to create a new fla
          > file
          > and save 3.0 in the publish settings. so then i got about my business,
          > create
          > a movie clip that i want to use as a button, jump into my actions panel,
          > and
          > give that movie clip instance onRelease, onRollOver, and onRollOut
          > functions.
          > SHABAM!!! spot, we're not in the bahamas any more....
          >
          > needless to say, 3.0 doesn't work like that. so i tried to fix it from
          > the
          > compiler errors, i needed to create an eventListener. alright, i know how
          > to
          > do that. SHABAM!!! it got aggravating really quick, so then i try to
          > find
          > some documentation to guide me, but i'm finding it hard to find
          > information
          > basically with the idea of "i used to do this, so now what do i do?"
          > anyone
          > know of a tutorial that might help me?
          >


          • 2. Re: transition tutorial for as 3.0?
            Level 7
            NickTheNameless,

            > so then i try to find some documentation to guide me, but
            > i'm finding it hard to find information basically with the idea
            > of "i used to do this, so now what do i do?"

            I wrote a recent blog entry on button event handling in AS3, because I
            saw so many people asking why buttons don't work in Flash CS3. They do, of
            course, but as you've seen, AS3 is a different beast. For the time being,
            it's easy enough to change your publish settings back to AS2 (or even AS1)
            until you feel comfortable with the new stuff, but I certainly applaud
            anyone already taking the plunge.

            http://www.quip.net/blog/2007/flash/making-buttons-work-in-flash-cs3

            It's basic stuff, but it's arguably what you're after (as in, "How do I
            do this now?").


            David Stiller
            Co-author, Foundation Flash CS3 for Designers
            http://tinyurl.com/2k29mj
            "Luck is the residue of good design."