Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loading XML data into a movie clip

Status
Not open for further replies.

niche88

Technical User
Feb 2, 2010
1
JP
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!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top