Forums / Developer / XML Driven Flash / Comment59308
Anaya P
Wednesday 26 May 2010 7:29:59 am
Thanks for your quick reply.
As you suggested I have tried to pass flashvars through html to swf file. But it is not working properly.
I am not flash expert, so may be have missed any step.
I have followed below steps -
1. created a variable of type string
2. in html passed value as a name of xml file.
In flash actionscript have below code -
function loadXML(loaded) { if (loaded) { _root.booth = this.firstChild.childNodes[62].childNodes[0].firstChild.nodeValue; _root.area = this.firstChild.childNodes[62].childNodes[1].firstChild.nodeValue; _root.price = this.firstChild.childNodes[62].childNodes[2].firstChild.nodeValue; _root.company = this.firstChild.childNodes[62].childNodes[3].firstChild.nodeValue; _root.website = this.firstChild.childNodes[62].childNodes[4].firstChild.nodeValue; booth_txt.text = _root.booth; area_txt.text = _root.area; price_txt.text = _root.price; company_txt.text = _root.company; website_txt.text = _root.website; } else { trace(" file not loaded! " ); } } xmlData = new XML(); xmlData.ignoreWhite = true; xmlData.onLoad = loadXML; xmlData.load(" myFlashVar " ) ;
value to myFlashVar is passed using flashvars syntax in html embed and object tag.
Can you please let me know what wrong i am doing here.
Regards