【问题标题】:passing variables from Html StageWebview to actionscript将变量从 Html StageWebview 传递到 actionscript
【发布时间】:2019-01-06 04:06:47
【问题描述】:

如何获取用户名字段数据并将其传递给 Actionscript?
请帮助我编写此代码作为我正在尝试做的示例...

从用户名中获取数据并将其传递给 Flash 中的txtc.text:

var webView:StageWebView = new StageWebView(); 
webView.viewPort = new Rectangle( 200, 200, this.stage.stageWidth, 
this.stage.stageHeight); 
webView.stage = this.stage; 
var htmlString:String = "<form action='/action_page.php'>" +
"First name:<br>" +
"<input type='text' name='firstname' value='Mickey'><br>" +
"Last name:<br>" +
"<input type='text' name='lastname' value='Mouse'><br><br>" +
"<input type='submit' value='Submit'>" +
"</form>";
webView.loadString(htmlString);
btn1.addEventListener(MouseEvent.CLICK, btn21e);
function btn21e(event:MouseEvent):void
{
txtc.text = String(htmlString); 
}

【问题讨论】:

  • 解决了吗?如果没有,请尝试在按下“提交”按钮时添加一些 Javascript 函数来复制文本条目,然后在 AS3 中使用 External Interface 从正在运行的 Javascript 函数接收文本...

标签: actionscript-3 flash actionscript air


【解决方案1】:

Afaik,StageWebView 出于安全原因被隔离,因此您不会得到结果。但是,MyFlashLabs 有一个 StageWebView ANE,它应该能够从 StageWebView 获取/传递结果。

【讨论】:

    猜你喜欢
    • 2012-07-25
    • 2013-05-28
    • 2011-11-05
    • 2016-10-25
    • 2021-12-29
    • 1970-01-01
    • 2017-06-12
    • 2017-06-30
    • 1970-01-01
    相关资源
    最近更新 更多