# Refer to XML object in main timeline from within a movieclip

**URL:** <https://forum.kirupa.com/t/refer-to-xml-object-in-main-timeline-from-within-a-movieclip/304064>\
**Category:** flash\
**Created:** [February 1, 2010, 2:40am UTC](https://forum.kirupa.com/t/refer-to-xml-object-in-main-timeline-from-within-a-movieclip/304064 "2010-02-01T02:40:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ni\_che](https://avatars.discourse-cdn.com/v4/letter/n/e79b87/32.png) [@ni\_che](https://forum.kirupa.com/u/ni_che)\
**Post date:** [February 1, 2010, 2:40am UTC](https://forum.kirupa.com/t/refer-to-xml-object-in-main-timeline-from-within-a-movieclip/304064/1 "2010-02-01T02:40:15Z")

</div>

I would like to know how to access a XMLList object in main timeline from movieclips.  
Can XML be accessed through 2nd level(nested movieclips)?

# 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);  
[COLOR=red]data[/COLOR] = xmlData.children();

# }

Inside a movieclip, in frame 1, how to refer to [COLOR=red]data(xmlList object)[/COLOR] in main timeline and pass it to a new XMLList inside the movieclip?  
================================================== ==  
var titleChildren:XMLList = [COLOR=red]data[/COLOR].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!
