1 Reply Latest reply on Apr 25, 2011 4:51 AM by Ned Murphy

    flash

    TorsekarM29

      Hello,

         I want 2 make a smal  banner in flash which includes one movieclip & 5 buttons(1,2,3,4,5)

          That movieclip contain 5 pictures. I want that at click of each button,that perticular picture in movieclip will be seen.

         those buttons are initially black in color. but I want that after any click, color of that perticular button should be changed into white color & that color will remain white until we click on another button. can anyone tell me how can I  create this in macromedia flash 8.I've already created movieclip & buttons in working condition.but I couldn't change color of button into white till next click.

        • 1. Re: flash
          Ned Murphy Adobe Community Professional & MVP

          Use movieclips for the images and buttons.

           

          In each button movieclip have two frames, one for black and the other for white, with frame labels to match and stop() commands in each frame.  Create a reset function that tells all of the movieclips to gotoAndStop("black") and all the images to be invisible.  Assign the same clicking function to all of the buttons such that they first call the reset function and then command themselves to gotoAndStop("white");  Assign intances names to the buttons such as btn1, btn2, etc., and similarly for the images... img1, img2, etc.

           

          The following code placed in the timeline should work...

           

           

          //set things up

          for(i=1; i<6; i++){

               this["img"+i]._visible = false;               // hide the images

               this["btn"+i].img = this["img"+i];          // associate image with button

               this["btn"+i].onRelease = function(){

                    resetMCs();

                    this.gotoAndStop("white");

                    this.img._visible = true;

               }

          }

           

          // function to reset all buttons and images

          function resetMCs(){       for(i=1; i<6; i++){

                   this["btn"+i].gotoAndStop("black");

                   this["img"+i]._visible = false;

              }

          }

           

           

          If you want an image/button to be preselected at the start, just set them to be so after the "set things up" code