1 Reply Latest reply on Nov 13, 2011 7:49 PM by Ned Murphy

    linking listbox to frames

    gt119

      ok basicly i have a listbox which gets data striaght from my sql database and i was wondering how i could link each value with in the list box to each frame  so that when a item is selected in the list box it goes to a frame like how  button uses gotoandplay as such

       

       

      this is my code which i use to get the data from the database

       

      var theXML:XML = new XML();

      theXML.ignoreWhite = true;

       

      theXML.onLoad = function() {

          var nodes = this.firstChild.childNodes;

          for(i=0;i<nodes.length;i++) {

              theList.addItem(nodes[i].firstChild.nodeValue,i);

                                         

          }

      }

       

      theXML.load("http://localhost/project/php/question.php");

       

       

      thank you

        • 1. Re: linking listbox to frames
          Ned Murphy Adobe Community Professional & MVP

          While you are adding the data to the List, include the frame information as an added piece of data for each entry.  Look in the help documention to see how to use an object to add both label and data parameters to the List for each entry. 

           

          To make the List act like a button, look into using a listener for the Event.CHANGE occuring to detect when a selection is made.  This is also explained in the help documentation as well as other events that you might prefer to omonitor for instead.  The event handler function can use the selectedItem frame data in a gotoAndStop() or gotoAndPlay() command.

           

          The documentation has several examples that should be helpful for you.  Look into how a DataProvider is utilized to load up the component.