I've created simple swf with interface:
public class Test extends MovieClip implements ITest
{
public function Test()
{
Security.allowDomain("*");
Security.allowInsecureDomain("*");
}
public function speak(str):String
{
trace(str);
return "yeah";
}
}
ITest:
public interface ITest {
// Interface methods:
function speak(str):String
}
And then I'm trying to load it:
public function SWFLoader()
{
var url='http://xxxxxxxx/test.swf';
var loadURL:URLRequest=new URLRequest(url);
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
var context:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain);
loader.load(loadURL, context);
}
private function completeHandler(event:Event):void
{
var test:ITest;
test = event.target.content as ITest;
test.speak("ggg");
}
So if I have test.swf in the same directory(local way) it work's fine. But if I'm placing it on the dedicated server: (event.target.content as ITest) returns null. However, I can access speak() without interface like this event.target.content.speak("a!");
How to solve this problem?