actionscript 3 - XML and Dynamic Textfields -


i'm trying import content of xml inside dynamic textfields. managed it, project asks more: basically, have list of names (say auguste, tibere, claude). when click on 1 of them, biography of him appears (an image , several textfields). 2 textfields filled parts of xml depending of name clicked. part doesn't work... no matter name click, textfields don't change. hope can :). here code:

var myxml:xml = new xml(); var xml_url:string = "assets/fiches.xml"; var myxmlurl:urlrequest = new urlrequest(xml_url); var myloader:urlloader = new urlloader(myxmlurl); myloader.addeventlistener("complete", xmlloaded); var list:number = 0;  function xmlloaded(event:event):void{     myxml = xml(myloader.data);     fnpeople(myxml); };  function fnpeople(peoplelist:xml):void{ nom.text = peoplelist.person.name.text()[list]; vie.text = peoplelist.person.comment.text()[list]; };  /*auguste*/ liste_a1.auguste_liste.addeventlistener(mouseevent.click, fl_auguste); function fl_auguste(mouseevent: event): void { auguste.visible = true; close_fiches_btn.visible = true; nom.visible = true; vie.visible=true; list=0; };  /*tibère*/ tibere_arbre.addeventlistener(mouseevent.click, fl_tibere); function fl_tibere(mouseevent: event): void { tibere.visible = true; close_fiches_btn.visible = true; tibere_txt.visible = true;     list=1 }; 

the xml file pretty simple:

<people>  <person> <name>auguste</name> <comment>text</comment> </person>  <person> <name>tibere</name> <comment>text</comment> </person>  </people> 

textfields don't update because don't invoke update function fnpeople anywhere. add following row functions fl_auguste , fl_tibere:

fnpeople(myxml); 

this should update textfields.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -