4 Replies Latest reply on Sep 11, 2007 7:32 AM by FlashRenaissance

    Flash CS3 won't do rolloverrs!!

    FlashRenaissance Level 1
      I am using Flash CS3 on a Mac. I am trying to do something I have done many times before- that is create a button made with a movie clip. This is done with an invisible button going to the various states in the MC using frames. I am making sure the frames are NOT on the same keyframe as the STOP ACTION. But it's not working.
      Did Adobe do something new with Action Script? I am publishing it as Action Script 2.0.

      quote:

      on (rollOver) {
      //this.gotoAndPlay("benefits, startbutton");
      this.gotoAndPlay.benefits("startbutton");

      }



      Thanks for your help.
        • 1. Re: Flash CS3 won't do rolloverrs!!
          clbeech Level 3
          I think that in AS3, they have eliminated the use of attaching code directly to instances, but I guessing, I'm still wirting AS2. I think you have to call a MouseEvent:onRollOver, or something like that, but that doesn't explain why it desn't work if your publishing down. No help, sorry :)
          • 2. Re: Flash CS3 won't do rolloverrs!!
            FlashRenaissance Level 1
            By the way, sorry about the multiple posts.
            • 3. Re: Flash CS3 won't do rolloverrs!!
              Level 7
              FlashRenaissance,

              > Did Adobe do something new with Action Script?

              With ActionScript 3.0? Plenty. ;)

              > I am publishing it as Action Script 2.0.
              >
              >
              quote:

              on (rollOver) {
              > //this.gotoAndPlay("benefits, startbutton");

              In AS2, the on() and onClipEvent() functions still work the same as
              ever. The above syntax would only make sense, though, if your destination
              were actually labeled "benefits, startbutton" (complete with the comma and
              space character).

              > this.gotoAndPlay.benefits("startbutton");

              This line has a few syntax problems, actually. The
              MovieClip.gotoAndPlay() method accepts a parameter, which it looks like
              you're using with the reference to "startbutton", but you're invoking that
              parameter inside a set of parentheses that appears after the word
              "benefits". That means "benefits" is a method (a function) of the object it
              belongs to, and since "benefits" appears after a dot that follows
              "gotoAndPlay", the line as written expects an object by the instance name of
              gotoAndPlay whose class defines a method named benefits.

              My hunch is that the movie clip in question -- the one on which this
              on() function is attached -- contains a nested movie clip with the instance
              name "benefits". If that's so, and if you're asking benefits to perform the
              MovieClip.gotoAndPlay() method, then the code should look like this:

              on (rollOver) {
              this.benefits.gotoAndPlay("startbutton");
              }

              Does that make sense?


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


              • 4. Re: Flash CS3 won't do rolloverrs!!
                FlashRenaissance Level 1
                I found out what I did wrong.
                I had a space after the label name. I did not know I made this space. As a result, I needed this space before the second quote:

                on (press){
                this.benefits.gotoAndStop("pressbutton ");


                }

                Next time I have to be more careful and not let that space appear when making the label in the properties panel.