This should give you an idea. Assuming your xml is something like this
<?xml version="1.0" encoding="UTF-8"?>
<myTexts>
<bullestext> <bulle> text1a </bulle> </bullestext>
<bullestext> <bulle> text2b </bulle> </bullestext>
<bullestext> <bulle> text3c </bulle> </bullestext>
<bullestext> <bulle> text4d </bulle> </bullestext>
<bullestext> <bulle> text5e </bulle> </bullestext>
</myTexts>
then you can do your code like this..
var myXML5: XML = new XML();
var XML_URL5: String = "assets/bulles.xml";
var myXMLURL5: URLRequest = new URLRequest(XML_URL5);
var myLoader5: URLLoader = new URLLoader(myXMLURL5);
myLoader5.addEventListener("complete", xmlLoaded5);
var list5: Number = 0;
function xmlLoaded5(event: Event): void
{
trace ("XML loaded complete");
myXML5 = XML(myLoader5.data);
//trace (myXML5); ///show xml contents
//fnPeople5(myXML5);
france_map.gotoAndStop(3); //for test (shows xml entry [3] later on)
bulles2();
}
//testing without event (click event?)
//function bulles2(e: Event): void
function bulles2(): void
{
var i5: int = france_map.currentFrame; //.currentFrame();
list5 = i5 - 1; //frame [1] is equal to xml entry [0] so we minus by 1
trace ("list5 : " + list5);
fnPeople5(myXML5);
}
function fnPeople5(peopleList5: XML): void
{
//testing traces
trace(peopleList5.bullestext[0].bulle);
trace(peopleList5.bullestext[4].bulle);
//show entry (example: entry 3)
bulles.text = peopleList5.bullestext[list5].bulle;
}
I didn't setup a mouse/keyboard event for testing but no worries, nothing wrong with what you had before so you can still use function bulles2(e: Event): void
with your own full code. Also because XML counts from zero but frame count is from one we know that every XML entry equals Frame number minus one less.
If text doesn't show in the textField
but works ok with trace in fnPeople5(peopleList5: XML): void
then try embedding font. Check this link: What methods are there for creating FLAs with dynamically created text, that outputs swfs with only the font glyphs included that are required?