更改 htmlLoader 的位置时未调度 LOCATION_CHANGING 事件
我想在 AIR 2.7 中引入的 LocationChangeEvent.LOCATION_CHANGE 事件上做我的事情,但该事件没有被调度。我的示例代码如下。请帮助我知道我做错了什么。
protected function button1_clickHandler(event:MouseEvent):void {
this.page.location = "http://www.google.co.in";
}
protected function locationChanging(event:LocationChangeEvent):void {
trace("location Changing");
}
protected function page_creationCompleteHandler(event:FlexEvent):void {
this.page.htmlLoader.addEventListener(LocationChangeEvent.LOCATION_CHANGING, locationChanging, false, 10, false);
}
<mx:HTML id="page" width="100%" height="100%" creationComplete="page_creationCompleteHandler(event)"/>
I want to do my stuff on LocationChangeEvent.LOCATION_CHANGE event which is introduced in AIR 2.7 but this event is not getting dispatched.My sample code is below. Please help me know if there is anything wrong that I am doing.
protected function button1_clickHandler(event:MouseEvent):void {
this.page.location = "http://www.google.co.in";
}
protected function locationChanging(event:LocationChangeEvent):void {
trace("location Changing");
}
protected function page_creationCompleteHandler(event:FlexEvent):void {
this.page.htmlLoader.addEventListener(LocationChangeEvent.LOCATION_CHANGING, locationChanging, false, 10, false);
}
<mx:HTML id="page" width="100%" height="100%" creationComplete="page_creationCompleteHandler(event)"/>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经弄清楚为什么 locationChanging 事件没有调度。我做了一些事情来让它发挥作用。
I have figured out why locationChanging event was not dispatching. I did few things to make it work.