开发者

LOCATION_CHANGING event not getting dispatched when location of htmlLoader is changed

开发者 https://www.devze.com 2023-03-11 07:11 出处:网络
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 anyt

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, locati开发者_如何学编程onChanging, false, 10, false);
}
<mx:HTML id="page" width="100%" height="100%" creationComplete="page_creationCompleteHandler(event)"/>


I have figured out why locationChanging event was not dispatching. I did few things to make it work.

  1. I upgraded my flex sdk from Flex 4.1 to Flex 4.5
  2. Added compiler option -swf-version=12
  3. Overlayed AIR 2.7 sdk over Flex 4.5 sdk
0

精彩评论

暂无评论...
验证码 换一张
取 消