1 Reply Latest reply on Aug 26, 2009 9:15 AM by videostart

    loading multiple xml files into gallery with flash buttons

    videostart

      I have a flash component that is an image gallery.  I want to have multiple image galleries on my site, but instead of mutliple instances of the component, I want to have mutliple buttons that can be clicked that will load in different xml files to populate the component.

       

      Having trouble getting this to work.....

       

      Would code like this do something like that:

       

      var eventListener = new Object();

       

      eventListener.button_click = function (evnt){
      trace("Button clicked");
      }
      myGallery.addEventListener("button_click", eventListener);

        • 1. Re: loading multiple xml files into gallery with flash buttons
          videostart Level 1

          actually, I found that this is the code that would make it work for AS3, but does anyone know how to turn this into AS2 because my component is an AS2 component:

           

          button_instance.addEventListener(MouseEvent.CLICK,loadNewXML)
          button_instance2.addEventListener(MouseEvent.CLICK,loadNewXML)


          function loadNewXML(e:MouseEvent):void{
          switch(e.target)
          case button_instance:
             myGallery.contentXML = "yourNewXmlLocation.xml";
          break;
          case button_instance2:
             myGallery.contentXML = "yourNewXmlLocation2.xml";
          break;

          }