Creating a Killer Flash Site - Update 2: Crossdomain Security

Published May 10th, 2007 in: ActionScript 3, Flash

Ok, I just figuered out that the crossdomain security was causing some remoting trouble when accessing the domain without the www. The solution was to remove the static URL 'http://www.oysteinwika.com' from the ServiceProxy path.

ActionScript 3.0 Code:

// now with relative path ///
public function loadDoc(_type:String, _file:String):void {
proxy = new ServiceProxy("/services/gateway.php",
"com.oysteinwika.LoadDoc");
proxy.addEventListener(ResultEvent.RESULT,
onResult, false, 0, true);
proxy.addEventListener(FaultEvent.FAULT,
onFault, false, 0, true);
proxy.addEventListener(FaultEvent.CONNECTION_ERROR,
onConnectionError, false, 0, true);
proxy.getData(_type, _file);
}

About

You are currently browsing the Øystein Wika weblog.

Recent Posts