I've been trying to load xml data into a movie clip that's 2 levels into the main timeline, and it's not working....
If movie clip is it the main timeline everything works fine.
I'm assuming that xml only loads into the main timeframe, and that's the problem, but I'm not sure....
How to pass the XML object created in main timeline into a 2nd level movie clip?
In frame 1 of main timeline, the XML file has been loaded.
==========================================
var xmlData:XML = new XML();
var data:XMLList;
xmlData.ignoreWhite = true;
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("example.xml"));
xmlLoader.addEventListener(Event.COMPLETE, loadXML);
function loadXML(e:Event):void
{
xmlData = new XML(e.target.data);
data = xmlData.children();
}
==========================================
Inside a movieclip, in frame 1, how to refer to data(xmlList object) in main timeline and pass it to a new XMLList inside the movieclip?
================================================== ==
var titleChildren:XMLList = data.title.(@name == "D5").children();
.
.
.
I tried using the following in the movieclip but to no avail.
var data2:XMLList= new XMLList();
data2=parent.data;
and
var data2:XMLList= new XMLList();
data2=root.data;
Any help would be appreciated. Thanks!
If movie clip is it the main timeline everything works fine.
I'm assuming that xml only loads into the main timeframe, and that's the problem, but I'm not sure....
How to pass the XML object created in main timeline into a 2nd level movie clip?
In frame 1 of main timeline, the XML file has been loaded.
==========================================
var xmlData:XML = new XML();
var data:XMLList;
xmlData.ignoreWhite = true;
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("example.xml"));
xmlLoader.addEventListener(Event.COMPLETE, loadXML);
function loadXML(e:Event):void
{
xmlData = new XML(e.target.data);
data = xmlData.children();
}
==========================================
Inside a movieclip, in frame 1, how to refer to data(xmlList object) in main timeline and pass it to a new XMLList inside the movieclip?
================================================== ==
var titleChildren:XMLList = data.title.(@name == "D5").children();
.
.
.
I tried using the following in the movieclip but to no avail.
var data2:XMLList= new XMLList();
data2=parent.data;
and
var data2:XMLList= new XMLList();
data2=root.data;
Any help would be appreciated. Thanks!