Flex跳转问题

把要跳转的页新建成 MXML Component,然后通过 ViewStack 组件把这些页包含进来
<mx:ViewStack id="storeViews" width="100%" height="550" creationPolicy="all">
            <shouye id="homeView"  label="首    页" showEffect="WipeDown" hideEffect="WipeUp"  />
            <leixing id="pView"    label="模板类型"  showEffect="WipeDown" hideEffect="WipeUp" />
            <make id="supportView" label="立即制作" showEffect="WipeDown" hideEffect="WipeUp"  />
</mx:ViewStack>
然后再用别的组件切换这些页,比如用 Button
<mx:Button click="storeViews.selectedChild=homeView;"  />

Flex跳转到JSP或者其他非Flex页面我的解决办法


Html代码
var url:String="http://"+URLUtil.getServerNameWithPort(Application.application.url)+"/DZDJ/index.jsp?id=" + 1;  
                 ExternalInterface.call('window.open',url,'_top');  

_top是可变的,_top表示在当前页面打开,关闭远页面。



网上的:


导入类:

        import flash.net.URLRequest;
        import flash.net.navigateToURL;

关闭当前浏览器:

                        var url:URLRequest = new URLRequest("javascript:window.close()");
                        navigateToURL(url,"_top");

                        (注意:要在服务器上测试,否则会报安全沙箱冲突);

在浏览器上跳转页面

                        navigateToURL(new URLRequest("http://www.baidu.com"),"_top");

打开一个新的浏览器:

                       var request:URLRequest = new URLRequest("http://www.baidu.com/);
                       navigateToURL(request);


Flex跳转到Flex

FLEX和JSP不一样,没有所谓的这个页面跳转到另外的一个页面。一般都是用ViewStack进行页面切换,其他模块就需要loadmoudle进行函数设置了。

<mx:ViewStack x="0" y="0" id="viewstack1" width="619" height="700">
   <mx:Canvas id="View1" width="100%" height="100%">
      <mx:Button label="View2 " click="viewstack1.selectedChild=View2"/>
       </mx:Canvas>


   <mx:Canvas id="View2" width="100%" height="100%" color="#3FCFE9">
   </mx:Canvas>
</mx:ViewStack>

你可能感兴趣的:(JavaScript,jsp,浏览器,Flex,Flash)