Hi,
I am relatively new to AS3 and am having an issue, hoping someone can clear this one up for me.
What am I doing?
I have an AS2 file that is checking the domain it is hosted on against a whitelist of valid domains, then adding the validated domain to the string that passes an xml file to the swf. This is done to ensure that the incoming xml resides on the same server that the swf lives on. I can accomplish this in AS2 with the following code:
*** code***
#include “validateDomain.as” // details of file listed below
var lc:LocalConnection = new LocalConnection();
var swfDomain = lc.domain();
if (swfDomain == “localhost”) {
xmlURL = “gallery.xml”;
} else if (isValidDomain(swfDomain)) {
xmlURL = “http://” + swfDomain + _root.xmlfile;
}
*** end code ***
*** validateDomain.as***
function isValidDomain(domain:String):Boolean {
switch (domain) {
case “domain1.com” :
return true;
break;
case “domain2.com” :
return true;
break;
case “domain3.com” :
return true;
break;
default :
return false;
break;
}
}
*** end validateDomain.as***
the “_root.xmlfile” xml file is passed through swfobject flash vars
I need to be able to dot his, or some equivalent with AS3,
Any help most appreciated, thanks!