# Return XML to main function?

**URL:** <https://forum.kirupa.com/t/return-xml-to-main-function/326441>\
**Category:** flash\
**Created:** [December 14, 2011, 4:53pm UTC](https://forum.kirupa.com/t/return-xml-to-main-function/326441 "2011-12-14T16:53:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![daush](https://avatars.discourse-cdn.com/v4/letter/d/f05b48/32.png) [@daush](https://forum.kirupa.com/u/daush)\
**Post date:** [December 14, 2011, 4:53pm UTC](https://forum.kirupa.com/t/return-xml-to-main-function/326441/1 "2011-12-14T16:53:50Z")

</div>

Hi guyz, im stuck here.

i have my main function:

function main(){  
call\_xml(“myxml.xml”);  
trace(data)// NULL  
}

function call\_xml(){  
loader.(event.Complete, oncomplete);  
}

function oncomplete(){  
data = new XML(evt.target.data);  
trace data// OK XML  
}

so, i want to get my data XML var back to main, i get NULL (i think is oncomplete fault )

how can i do that??  
thanx!
