4 Replies Latest reply on Jun 22, 2010 8:22 PM by Puremedia

    How to make a mouse rollover showcase

    Puremedia

      Here is the image of what i'm looking for. http://img193.imageshack.us/img193/1180/servicek.jpg

       

      What i want is, when i move my mouse to square 1, it will go to Services,  when i move to square 2 it will go to News etc.

       

      i had tried

       

       

      number1.addEventListener(MouseEvent.CLICK, fl_ClickToGoTonews);

       

      function fl_ClickToGoTonews(event:MouseEvent):void
      {
          MovieClip(this.root).gotoAndStop(1, "news");
      }

       

       

      number2.addEventListener(MouseEvent.CLICK, fl_ClickToGoTonews);


      function fl_ClickToGoTonews(event:MouseEvent):void
      {
           MovieClip(this.root).gotoAndStop(1, "service");


      }

       

      etc.

       

      This code was working, but i could only moved forward, not backward, otherwise Duplicate funtions error (something like that) shows up.

       

      number 1 = Square 1 (Button)

      number2 = Square 2  (Button)

       

      news and service = the content i would go to when mouse rollover.

        • 1. Re: How to make a mouse rollover showcase
          Ned Murphy Adobe Community Professional & MVP

          The problem is as the error messages indicate.  You are using the same function name for two entirely different functions.  You cannot do that.  You need to change one of them, and the logical choice is to change the second....

           

           

          number1.addEventListener(MouseEvent.CLICK, fl_ClickToGoTonews);

           

          function fl_ClickToGoTonews(event:MouseEvent):void
          {
              MovieClip(this.root).gotoAndStop(1, "news");
          }

           

           

          number2.addEventListener(MouseEvent.CLICK, fl_ClickToGoToservice);


          function fl_ClickToGoToservice(event:MouseEvent):void
          {
               MovieClip(this.root).gotoAndStop(1, "service");


          }

          • 2. Re: How to make a mouse rollover showcase
            Puremedia Level 1

            oops, sorry for my poor copy & paste skill, i did changed to service with mine. xD

             

            the problem is i can't move backward, because each categories ( service, news etc)  are individual scene.

             

            news is my first scene, service is my second scene etc,

             

            number1.addEventListener(MouseEvent.CLICK, fl_ClickToGoTonews);


            function fl_ClickToGoTonews(event:MouseEvent):void
            {
                 MovieClip(this.root).gotoAndStop(1, "news");


            }

             

            number2.addEventListener(MouseEvent.CLICK, fl_ClickToGoToservice);


            function fl_ClickToGoToserviece(event:MouseEvent):void
            {
                 MovieClip(this.root).gotoAndStop(1, "service");


            }

             

            number3.addEventListener(MouseEvent.CLICK, fl_ClickToGoTocareer);


            function fl_ClickToGoTocareer(event:MouseEvent):void
            {
                 MovieClip(this.root).gotoAndStop(1, "career");


            }

             

            number4.addEventListener(MouseEvent.CLICK, fl_ClickToGoTobillboard);


            function fl_ClickToGoTobillboard(event:MouseEvent):void
            {
                 MovieClip(this.root).gotoAndStop(1, "billboard");


            }

             

            number5.addEventListener(MouseEvent.CLICK, fl_ClickToGoTocontact);


            function fl_ClickToGoTocontact(event:MouseEvent):void
            {
                 MovieClip(this.root).gotoAndStop(1, "contact");


            }

             

            i used for news (my 1stscene), but for service (2nd scene) i can't use the same AS again, Duplicate functions error (something like that) shows up.

             

            therefore, is there any way to avoid the Duplicate function error, or any other AS i can make the mouse rollover showcase ? Appreciated !!!

            • 3. Re: How to make a mouse rollover showcase
              Ned Murphy Adobe Community Professional & MVP

              First, try getting away from using scenes.  They work well for animation designs but are troublesome when you try to implement navigation using them.  Use sections of the first scene for what you have as scenes now.

               

              If you are getting duplicate function errors it means you are using the same functions more than once in your file.  As I mentioned already, you cannot do that.  If it is because you have different sets of buttons for the different scenes, but you duplicate the code in each scene, that will generate the errors.

              1 person found this helpful
              • 4. Re: How to make a mouse rollover showcase
                Puremedia Level 1

                thank you for pointing out my problems ~  is there any other  AS can do the same thing of what i want to do ??

                 

                please show me