Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache flex HTML控件';s赛事获胜';你不会开枪吗?_Apache Flex_Actionscript 3_Air - Fatal编程技术网

Apache flex HTML控件';s赛事获胜';你不会开枪吗?

Apache flex HTML控件';s赛事获胜';你不会开枪吗?,apache-flex,actionscript-3,air,Apache Flex,Actionscript 3,Air,我无法启动或捕获事件启动的结果 这是当前的代码 <s:Panel id="instructionsPanel" left="0" right="0" top="0" bottom="0" title="Register"> <mx:HTML id="htmlViewer" left="10" right="10" top="0" bottom="10" location="http://ramzsoft.com/software-optins/

我无法启动或捕获事件启动的结果

这是当前的代码

<s:Panel id="instructionsPanel" left="0" right="0" top="0" bottom="0" title="Register">
    <mx:HTML id="htmlViewer" left="10" right="10" top="0" bottom="10"
             location="http://ramzsoft.com/software-optins/easyspinner.html"/>
    <s:TextInput id="urlOutput" x="10" y="285" width="628" text="Not a test"/>
</s:Panel>

import flash.events.Event;
import flash.filesystem.File;
import flash.net.URLLoader;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequest;

import mx.controls.Alert;
import mx.managers.PopUpManager;

import org.osmf.utils.URL;

private var file:File = new File();
private const FIRST_RUN_TOKEN_FILE:File =
    File.applicationStorageDirectory.resolvePath("firstrun");

init();

private function init():void {
    htmlViewer.addEventListener(Event.LOCATION_CHANGE, onClosePanel);
}

private function onClosePanel(e:Event) {
    urlOutput.text = "test";
    instructionsPanel.visible = false;
}

导入flash.events.Event;
导入flash.filesystem.File;
导入flash.net.urloader;
导入flash.net.URLLoaderDataFormat;
导入flash.net.URLRequest;
导入mx.controls.Alert;
导入mx.managers.PopUpManager;
导入org.osmf.utils.URL;
private var file:file=new file();
私有常量第一次运行令牌文件:文件=
File.applicationStorageDirectory.resolvePath(“firstrun”);
init();
私有函数init():void{
htmlViewer.addEventListener(Event.LOCATION\u CHANGE,onClosePanel);
}
关闭面板上的专用功能(e:事件){
urlOutput.text=“测试”;
instructionsPanel.visible=false;
}
发生的情况是,用户在HTML查看器中填写表单,然后当他们单击submit按钮时,我希望收到页面更改的通知

如果它们在URL上登陆,那么它们将显示一条消息。如果它们在URL B上登陆,它们将显示另一个URL

然而,事件并没有触发

我还尝试了COMPLETE和HTML\u DOM\u初始化

有什么办法解释为什么它不能正常工作吗?

我不确定是否使用init();在无处无任何影响。无论如何,您不需要那个init,您可以直接通过MXML设置它。顺便说一句,我认为当您在HTML组件中手动设置位置时,不会发送位置更改,只有在单击链接(或重定向)时才会发送



您使用的是什么版本的Flex SDK?好的,那一定是AIR SDK版本,但事实上这正是我想知道的。我知道在AIR 2.7中为HmlLoader引入了一些事件(特别是位置更改),但我认为位置更改应该有效。htmlViewer是什么类型的对象?它是一个mx:HTML控件。我尝试的事件是从控件上的Adobe文档中提取的。请尝试在内部HtmlLoader(htmlViewer.HtmlLoader)上设置侦听器。它应该可以在mx:HTML控件上工作,但无论如何,让我们来试试。此外,我必须在编译设置中设置-swf version=12,以便在AIR2.7中正确触发所有事件,因此您可能希望尝试-swf version=11,甚至-swf version=12进一步查看后,看起来我的init函数根本没有运行。我明确地叫它,但它没有运行。。。这很奇怪。
<s:Panel id="instructionsPanel" left="0" right="0" top="0" bottom="0" title="Register">
    <mx:HTML id="htmlViewer" left="10" right="10" top="0" bottom="10"
             location="http://ramzsoft.com/software-optins/easyspinner.html"
             locationChange="onClosePanel(event)"/>
    <s:TextInput id="urlOutput" x="10" y="285" width="628" text="Not a test"/>
</s:Panel>