FlashVars Tutorial

In addition to specifying the xml file in the component's parameters, you can also specify the xml file to use in the source code of the html page you embed your swf file in, you do so using the FlashVars technique.

 

If you use the standard code for embedding a swf, you can specify the name of your xml file as follows:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="550" height="400" id="demo" align="middle">
  <param name="allowScriptAccess" value="sameDomain" />
  <param name="FlashVars" value="pollXML=myXmlFile.xml">
  <param name="movie" value="demo.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />
  <embed src="demo.swf" FlashVars="pollXML=myXmlFile.xml" quality="high" bgcolor="#ffffff" width="550" height="400" name="demo" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

Note, in this example the XML file is named 'myXmlFile.xml' and it must be set in both the object and the embed tags.