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 模型在y分布之外的数据上预测能力不好如何解决
  • ¥15 processing提取音乐节奏
  • ¥15 gg加速器加速游戏时,提示不是x86架构
  • ¥15 python按要求编写程序
  • ¥15 Python输入字符串转化为列表排序具体见图,严格按照输入
  • ¥20 XP系统在重新启动后进不去桌面,一直黑屏。
  • ¥15 opencv图像处理,需要四个处理结果图
  • ¥15 无线移动边缘计算系统中的系统模型
  • ¥15 深度学习中的画图问题
  • ¥15 java报错:使用mybatis plus查询一个只返回一条数据的sql,却报错返回了1000多条