3 Replies Latest reply on Jun 4, 2009 8:31 AM by kglad

    Data Binding?

    THE SNU66LER

      When I use xml so to create a menu I'm used to binding the XML info to the menu with 'attachMovie' or 'duplicateMovieClip'

       

      example would be

       

      <myMenu>

           <tab>

                <tabName>Tab 1</tabName>

                <tabDesc>bla bla</tabDesc>

           </tab>

           <tab>

                <tabName>Tab 2</tabName>

                <tabDesc>bla bla</tabDesc>

           </tab>

           <tab>

                <tabName>Tab 3</tabName>

                <tabDesc>bla bla</tabDesc>

           </tab>

      </myMenu>

       

      After parsing my xml in flash my menu build would look something like this:

       

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

           tabData = myMenu.tab[i];

           var tab = myTab.duplicateMovieClip("newTab"+i, i,  tabData );

      }

       

      My XML data is bound to each tab now. If I traced 'tabName' after a onPress event I would surely get the name of the tab defined in the XML.

       

      Now, to my question.

      I've created a map of the U.S. Each state is on the stage and now I have to attach information I have in a XML file to each state. Its probably a easy solution, but I can't figure out how to link the two together.