# How to read xml file from HTML in flash AS3 through flash var?

**URL:** https://forum.kirupa.com/t/how-to-read-xml-file-from-html-in-flash-as3-through-flash-var/322551
**Category:** flash
**Created:** [May 25, 2011, 7:11am UTC](https://forum.kirupa.com/t/how-to-read-xml-file-from-html-in-flash-as3-through-flash-var/322551 "2011-05-25T07:11:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![rahul7sy](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@rahul7sy](https://forum.kirupa.com/u/rahul7sy)
#### Post date: [May 25, 2011, 7:11am UTC](https://forum.kirupa.com/t/how-to-read-xml-file-from-html-in-flash-as3-through-flash-var/322551/1 "2011-05-25T07:11:35Z")

</div>

This is the AS3 code that calling xml file. I want to call this xml from html of this flash with flash var. Please help me. Thank you.

init();  
[COLOR=“Blue”]function[/COLOR] init():[COLOR=“blue”]void[/COLOR] {  
initXML([COLOR="#009900"]“load/1.xml”[/COLOR]);  
}  
[color="#808080"]//loading the \_xml[/COLOR]  
[COLOR=“Blue”]function[/COLOR] initXML(path:[COLOR=“blue”]String[/COLOR]):[COLOR=“blue”]void[/COLOR] {  
\_xmlLoader = [COLOR=“blue”]new URLLoader/COLOR;  
\_xmlLoader.[COLOR=“blue”]load[/COLOR]([COLOR=“blue”]new URLRequest/COLOR);  
\_xmlLoader.[COLOR=“blue”]addEventListener/COLOR;  
[COLOR=“blue”]function[/COLOR] onComplete(e:[COLOR=“blue”]Event[/COLOR]):[COLOR=“blue”]void[/COLOR] {  
\_xml = [COLOR=“blue”]new XML/COLOR;  
\_xmlList = \_xml.image;  
\_totalEntries = \_xml.image.[COLOR=“blue”]length/COLOR;
