I get an error Parameter url must be non-nullwhen trying to transfer the path of the XML file to the Shockwave Flash object.
The javascript code is as follows
<script type="text/javascript">
var so = new SWFObject("preview.swf", "", "100%", "100%", "9", "#ffffff");
so.addParam("allowFullScreen", "true");
so.addParam("scale", "noscale");
so.addParam("menu", "false");
so.addVariable("xmlPath", "xml/exampleData.xml");
so.write("flashcontent");
</script>
As you can see the XML file I'm trying to load in the SWF file, this is exampleData.xml
In ActionScript, I declared the xmlPath variable as follows:
public var xmlPath:String
and in the boot event I made the appropriate changes.
private function loadComp(data:String):void
{
xmlModel.xml = new XML(data);
new LoadXml(xmlPath, picHandler);
}
And here is the question.
What am I doing wrong here? Why am I getting an error Parameter url must be non-null?
PS If I hardcode the path, everything works fine in the actionscript file!
private function loadComp(data:String):void
{
xmlModel.xml = new XML(data);
new LoadXml('xml/exampleData', picHandler);
}