Хочу в контейнере обратиться к внешнему php скрипту. Код без контейнера работает прекрасно.
Код AS3:
public function Main():void {
var stat_loader:URLLoader = new URLLoader();
var stat_request:URLRequest=new URLRequest("http://mysite/stat.php");
stat_request.method=URLRequestMethod.POST;
var stat_vars:URLVariables = new URLVariables();
stat_vars['auth_key']=LoaderInfo(root.loaderInfo).parameters.auth_key;
stat_vars['viewer_id']=LoaderInfo(root.loaderInfo).parameters.viewer_id;
stat_request.data=stat_vars;
stat_loader.load(stat_request);
}
Постарался переделать код под контейнер:
Код AS3:
public function Main():void
{
this.addEventListener( Event.ADDED_TO_STAGE, onAddedToStage );
}
private function onAddedToStage(e: Event):void
{
wrapper = Object(parent.parent);
Security.allowDomain("*");
stage.dispatchEvent(new Event(Event.DEACTIVATE));
stage.dispatchEvent(new Event(Event.ACTIVATE));
var stat_loader:URLLoader = new URLLoader();
var stat_request:URLRequest = new URLRequest("http://mysite/stat.php");
stat_request.method = URLRequestMethod.POST;
var stat_vars:URLVariables = new URLVariables();
auth_key = wrapper.application.parameters.auth_key;
viewer_id = wrapper.application.parameters.viewer_id;
stat_request.data = stat_vars;
stat_loader.load(stat_request);
}
Ничего не выходит, подскажите в чём ошибка.