hello i have started learning action script and ive been trying to create a dynamic nav bar.
the xml i have is
<home>
<navLinks>
<links>DESIGNER IN FOCUS</links>
<links>EMERGING TALENT</links>
<links>FASHION MENTOR</links>
<links>E-BOUTIQUE</links>
<links>FASHION JOBS</links>
</navLinks>
and i have found that
mainNavCont_mc.link01.linkTxt.text = "text in here";
works to replace one dynamic text (link01) on my stage, but i need to make it loop through and replace each of my links with xml
this is what i have so far
var fashionDataXML:XML;
var xmlLoader = new URLLoader;
trace("this runs");
xmlLoader.load(new URLRequest("fashionData.xml"));
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
function xmlLoaded(evt:Event):void{
if ((evt.target as URLLoader) != null){
fashionDataXML = new XML(xmlLoader.data);
fashionDataXML.ignoreWhitespace = true;
}//if
createMenu();
}//function xmlLoaded
function createMenu ():void {
var i:uint = 0;
trace("creatMenu");
var links = fashionDataXML.home.navLinks.links;
trace(links.length());
trace("length traced");
for ( var q=0;q<links.length();q++ ) {
}
this all works so far -
as i understand the xml data is placed as text into fashionDataXML and the createMenu function has <links> tag targeted in my XML.
the q in the last for loop hits all 5 links as 0 1 2 3 4.
So im now stuck trying to think of what to do next to get each dynamic text from the xml placed into each link - link01 link02 link03 link04 and link05
i hope i have explained things well. thank you