3 Replies Latest reply on Feb 12, 2010 6:43 AM by kglad

    Button Help

    Man213Ba213rt123

      Hi. Its been a while since i used flash and i need some action script for my latest project.

       

      On my button i want:

       

      aboutUs_mc to play when mouseover

      aboutUs2_mc to play when mousedown

       

      i also dont want either to play until both the mouseover and mousedown happens.

      i also dont want them movieclips looped.

       

      can any1 help me? thank you very much =)

       

      (ps if you could tell me where to put the actionscript as well that wud be very helpful, thanks.)

        • 1. Re: Button Help
          kglad Adobe Community Professional & MVP

          you want aboutUs_mc to play when its rolled over by the mouse?

           

          you want aboutUs2_mc to play when the mouse is pressed while over it?

           

          if yes and yes, use:

           

          aboutUs_mc.onRollOver=function(){

          this.play();  // place a stop() in frame 1 and the last frame of aboutUs_mc

          delete this.onRollOver;

          }

          aboutUs2_mc.onPress=function(){

          this.play();  // place a stop() in frame 1 and the last frame of aboutUs2_mc

          delete this.onPress;

          }

          • 2. Re: Button Help
            Man213Ba213rt123 Level 1

            Hi thanks for the help, i did exactly what you said, but it still doesnt work.

             

            ill try to explain again, maybe im doing something wrong?

             

            i have a movieclip called menu1 - inside this movie clip i have a

             

            graphic (no relivance)

            aboutUs_mc (movieclip1)

            aboutUs2_mc (movieclip2)

            a_btn (my button)

            also there is a layer with the code specified above.

             

            these are all on different layers inside the first movieclip (menu1)

            the button (a_btn) must play aboutUs_mc when rollover and aboutUs2_mc when clicked.

             

            so far this isnt working with the code:

             

            aboutUs_mc.onRollOver=function(){

             

            this.play();  // place a stop() in frame 1 and the last frame of aboutUs_mc

             

            delete this.onRollOver;

             

            }

             

            aboutUs2_mc.onPress=function(){

             

            this.play();  // place a stop() in frame 1 and the last frame of aboutUs2_mc

             

            delete this.onPress;

             

            }

             

            please help. many thanks

            • 3. Re: Button Help
              kglad Adobe Community Professional & MVP

              if the code is on the timeline that contains menu1, use:

               

              menu1.a_btn.onRollOver=function(){

               

              this._parent.aboutUs_mc.play();  // place a stop() in frame 1 and the last frame of aboutUs_mc

               

              delete this.onRollOver;

               

              }

               

              menu1.a_btn.onPress=function(){

               

              this._parent.aboutUs2_mc.play();  // place a stop() in frame 1 and the last frame of aboutUs2_mc

               

              delete this.onPress;

               

              }