3 Replies Latest reply on Jan 31, 2009 10:04 AM by Ned Murphy

    buttons to activate flash gallery

    glndi Level 1
      I'm doing my portfolio page and want to display four types of art, for which I've created four buttons. Upon opening, the page shows my company logo. When any of the buttons is clicked I would like it to then replace my company logo with the flash gallery.

      The flash gallery is done in action script which I've attached to a frame on the timeline.

      How do I code the flash gallery so it does not play until clicked? How do I code the button to activate the gallery?
        • 1. Re: buttons to activate flash gallery
          Ned Murphy Adobe Community Professional & MVP
          You probably need to place the gallery code in a function so that it is not processed until it is called upon by the button(s).

          example:

          btn1.onRelease = function () {
          // gallery code
          }

          Without seeing what kind of code you have for the gallery, that's the best I can offer at the moment.

          • 2. Re: buttons to activate flash gallery
            glndi Level 1
            Thanks Ned for responding.
            My code is a purchased gallery and I posted it in another question here
            • 3. buttons to activate flash gallery
              Ned Murphy Adobe Community Professional & MVP
              kGlad is right, nobody's likely to go thru all of that code, but in a glance, I'll offer the following thing to try (though I haven't gone thru the detail code to see if I'm off target)...

              create a button, add it to the stage, and give it an instance name of btn1

              In the code you showed, include the following way at the end after the last ' } '

              btn1.onRelease = function () {
              create_gallery();
              }

              and for the code that's there now, change the following function as shown here... adding the btn1 line before it.


              btn1._visible = false;
              xml.onLoad = function(ok)
              {

              // if (ok) create_gallery();

              if (ok) btn1._visible = true;
              }

              those two slashes are essentially commenting out the code so that line of code won't do anything. Now, instead of that function making the gallery appear, it will make the button appear when the gallery is ready... the button will make the gallery appear.

              That should at least give you a start.