Контейнер. Внешний php.
Добавлено: 13 сен 2011, 17:51
Хочу в контейнере обратиться к внешнему php скрипту. Код без контейнера работает прекрасно.
Код AS3:
Постарался переделать код под контейнер:
Код AS3:
Ничего не выходит, подскажите в чём ошибка.
Код 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); }