5 Replies Latest reply on Mar 7, 2007 3:08 PM by kglad

    onRollover problem

    jl2000 Level 1
      Hi - I have a button (instance name - ans2a1) that changes color on the Over. I brought this button into a movie clip and animated it. I brought that mc (instance name - btnFly1) onto the main time line and want to have text appear in a neighboring TextField (description_t) when the button is rolled over.

      It seems I can either have the Over state in the button OR I can have the text appear but not both... depending on how I target the button in the code. This can't be right and I can't get it right.

      TIA some help with this extremely basic problem,
        • 1. Re: onRollover problem
          kglad Adobe Community Professional & MVP
          is description_t on the main timeline? when you button animates is your mouse still over it?
          • 2. onRollover problem
            jl2000 Level 1
            kglad -
            "description_t " IS on the main timeline.

            I'm not sure what you mean by "when you button animates is your mouse still over it?" but here's what I have:

            In a new mc I put an instance of the btn called "gBtn" and gave it the instance name "ans2a1". On it's own layer I animated ans2a1 to fly across the stage.

            I named this new movie clip btnFly1 and placed an instance of it on the main timeline. That instance is also named btnFly1.

            When I test the FLA, the btn flies by so fast that it is only usable after it comes to a halt. When I roll over btnFly1 I expect to see the Over state that is built into ans2a1 and text to show up in description_t . But I don't get what I expect. What's wrong with it?

            I hope this clarifies things and that you can help me fix this.

            Thanks for the response.

            • 3. Re: onRollover problem
              kglad Adobe Community Professional & MVP
              your 2nd code won't work because btnFly1 is intercepting the mouse event so your button can't respond to it.

              your first code snipet should work IF your mouse is over the button for a perceptible length of time. but if your button moves away from your mouse quickly enough, you won't see the over state of your button because your mouse isn't over the button for sufficient time.
              • 4. Re: onRollover problem
                jl2000 Level 1
                kglad -
                Thanks so much for the quick reply.
                To reply to your comment - the btn doesn't move when the mouse is over it. You can't touch the btn DURING it's movement...its just too fast. All the button is supposed to do is change color.

                So based on your confirmation that the code SHOULD work I went back to stare at the btnFly1 mc where I have animated the btn. It's a multi-frame animation - not a tween. I only gave gBtn an instance name on the last frame - the frame when the button is finished moving. I noticed that there was no instance name on the 10 keyframes before that...so I filled those in - and now it works.

                The instance of gBtn had to be named in every keyframe of the multi-frame animation even though the mouse would only rollover the btn - and the code only addresses the btn - when it was sitting still in frame 11. All the keyframes had to have the same instance name for the code to work.

                Thanks for your input. Sorry to have taken your time with such a dumb mistake.

                • 5. Re: onRollover problem
                  kglad Adobe Community Professional & MVP
                  you're welcome.