douzhan5262 2012-11-29 14:23
浏览 93
已采纳

UDK Scaleform 4 AS3跨域URLRequest可能吗?

I want to post and get Highscores for my UDKGame via HTTP Requests to my webserver with an online Mysql database, Scaleform 4 (AS3) and PHP. Unfortunately I think that may not be possible, considering this document: http://gameware.autodesk.com/documents/gfx_4.0_flash_support.pdf .

I tried sending an URLRequest from my GFx Movie Player, but it doesn't seem to work. Heres my AS3 Code I'm using for my GFx Movie Player in Frame 1:

getScore();

function getScore():void {
//var url:String = "http://myserver.com/getScore.php";
    var request:URLRequest = new URLRequest(url);
    var requestVars:URLVariables = new URLVariables();
    requestVars.foo = "bar";
    request.data = requestVars;
    //request.method = URLRequestMethod.POST;
    //Security.allowDomain("myserver.com"); 
    //var context:LoaderContext = new LoaderContext();
    //context.securityDomain = SecurityDomain.currentDomain

    var urlLoader:URLLoader = new URLLoader();
    urlLoader = new URLLoader();
    urlLoader.dataFormat = URLLoaderDataFormat.TEXT;
    urlLoader.addEventListener(Event.COMPLETE, loaderCompleteHandler, false, 0, true);
    urlLoader.load(request);

    }

function loaderCompleteHandler(e:Event):void {
    trace(e.target.data);
    Object(this).response.text= "response:"+e.target.data;

}

Is There any way to achieve my goal without writing a .dll or use a manual TCP connection to my webserver?

  • 写回答

2条回答 默认 最新

  • doumeng3080 2012-12-03 21:31
    关注

    Unfortunately, the Scaleform that comes with UDK (4.0.16) does not have any networking support built into it. You'll have to have UDK do that part of the problem via dll bind or something else. Scaleform 4.2 added networking support but that version of Scaleform is not quite yet integrated into UDK. It IS in the process of being integrated though, so hopefully we'll see it soon.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 正弦信号发生器串并联电路电阻无法保持同步怎么办
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 个人网站被恶意大量访问,怎么办
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)