尝试使用事件处理程序在按下后退时处理stagewebview

时间:2011-11-15 03:11:48

标签: actionscript-3 flex

如何在stagewebview中添加一个事件处理程序,以便在Android手机上的后退按钮或我的操作栏上的popview按钮被按下时自动处理?这是我到目前为止所拥有的......

    <?xml version="1.0" encoding="utf-8"?>    
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:ns1="*"
    title="{data.image}"
    creationComplete="view1_creationCompleteHandler(event)" >
<fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
    <![CDATA[
        import mx.events.FlexEvent;

        public var webView:StageWebView=new StageWebView();
        protected function view1_creationCompleteHandler(event:FlexEvent):void
        {

            webView.stage=this.stage;
            webView.viewPort=new Rectangle(0,50,stage.stageWidth, stage.stageHeight);
            var fPath:String=new File(new File("app:/assets/chapter1images/image1.html").nativePath).url;
            webView.loadURL(fPath);
        }



    ]]>
</fx:Script>

0 个答案:

没有答案