I have, lets say, 20 movie clips on stange all with instance names. When a user logs in I want to be able to assign only certain movieclips with eventListeners. The list of movieclips to receive these event listeners is held in database and passed to Flash as XML.
xmlLIST :<uNav>
<unavNavID>1</unavNavID>
<navRef>navBtns.nav01</navRef>
</uNav>
<uNav>
<unavNavID>2</unavNavID>
<navRef>navBtns.nav02</navRef>
</uNav>
<uNav>
<unavNavID>3</unavNavID>
<navRef>navBtns.nav03</navRef>
</uNav>
So, what I want to do is be able to take the xml values in a for loop and get the saved as objects and then assign the appropriate event listeners like this
for(var i:int = 0; i < uNavXML.length(); i++){
navObj[i] = uNavXML..navRef.text()[i];
navObj[i].addEventListener(MouseEvent.MOUSE_OVER, mOvNav);
navObj[i].addEventListener(MouseEvent.MOUSE_OUT,mOuNav);
navObj[i].addEventListener(MouseEvent.CLICK,goPage);
}
Just can’t seem to get it to work. Is there a way to do this in Flash actionscript in CS4? Any help or steer would be appreciated