Hi i’m new to flash as3 and i have some issues with my flash
I have multiple movieclips (they all have instance names) and i want to display a text loaded from a xml file.
I have loaded the xml file and it work fine but instead of trace the code i want to “eco” display it into my flash file when i click on a movieclip.
Here’s what i have done until now.
import flash.display.*;
import flash.net.URLRequest;
import flash.events.Event;
import flash.text.TextField;
romania.addEventListener(MouseEvent.CLICK, onClickHandler);
function onClickHandler(myEvent:MouseEvent){
trace("I waited for Press AND Release!!!");
}
as you can see the romania movieclip when i click on that it trace a text
I have also loaded the xml file
and here’s the code
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
xmlLoader.load(new URLRequest("xml/tari.xml"));
function LoadXML(e:Event):void {
xmlData = new XML(e.target.data);
ParseBooks(xmlData);
}
function ParseBooks(bookInput:XML):void {
trace("XML Output");
trace("------------------------");
var titleList:XMLList = bookInput.Tara.title;
for each (var titleElement:XML in titleList) {
trace(titleElement);
}
}
and here’s my xml file
<?xml version="1.0" encoding="UTF-8"?>
<Tari>
<Tara NUME="Romania">
<title>Acesta este un text pentru Romania</title>
<nume>Romania</nume>
</Tara>
<Tara NUME="Ungaria">
<title>Acesta este un text pentru Ungaria</title>
<nume>Ungaria</nume>
</Tara>
<Tara NUME="Grecia">
<title>Acesta este un text pentru Grecia</title>
<nume>Grecia</nume>
</Tara>
<Tara NUME="Germania">
<title>Acesta este un text pentru Germania</title>
<nume>Germania</nume>
</Tara>
<Tara NUME="Austria">
<title>Acesta este un text pentru Austria</title>
<nume>Austria</nume>
</Tara>
<Tara NUME="Seriba">
<title>Acesta este un text pentru Serbia</title>
<nume>Serbia</nume>
</Tara>
<Tara NUME="Bulgaria">
<title>Acesta este un text pentru Bulgaria</title>
<nume>Bulgaria</nume>
</Tara>
</Tari>
I really need HELP please.