现在的位置: 首页 > 综合 > 正文

Flex 页面跳转 页面布局

2013年12月12日 ⁄ 综合 ⁄ 共 2086字 ⁄ 字号 评论关闭

 
1
、使用navigateToURL,主要方式如下:var url:String = "http://localhost:8080/Flex_J2eeDemo/bin/Welcome.html";

                                                                  
var request:URLRequest = new URLRequest(url);

                                                                  
navigateToURL(request,"_blank");

 

但是这个方法很郁闷就是页面切换总是弹出新的页面,而不是只变换url

 

 
2
、也是我采用的方法,就是引用flash中的 import flash.external.ExternalInterface
这个接口,他能提供像jspwindow.location.href方法一样方便,主要代码为:
ExternalInterface.call("function()

 

{window.location.href='http://localhost:8080/Flex_J2eeDemo/bin/Welcome.html';}

===

flex常用的页面布局方式主要分为4:

一、垂直拆分结构

 

二、嵌套层次结构

 

三、水平拆分结构

 

四、目录结构

 

例如:垂直拆分结构:

Xml代码

  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="100%" height="100%">  
  3.     <mx:Panel width="90%" height="90%" layout="absolute" title="垂直拆分结构" fontSize="14" paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="100" horizontalCenter="0" verticalCenter="0">  
  4.         <mx:HDividedBox x="0" y="0" width="100%" height="100%">  
  5.             <mx:Canvas width="30%" height="100%" backgroundColor="#FFFFCC">  
  6.                 <mx:Label x="0" y="10" text="左面组件容器"/>  
  7.             </mx:Canvas>  
  8.             <mx:Canvas width="70%" height="100%" backgroundColor="#99CCFF">  
  9.                 <mx:Label x="0" y="10" text="右面组件容器"/>  
  10.             </mx:Canvas>  
  11.         </mx:HDividedBox>  
  12.     </mx:Panel>  
  13. </mx:Application>  
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="100%" height="100%">
 <mx:Panel width="90%" height="90%" layout="absolute" title="垂直拆分结构" fontSize="14" paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="100" horizontalCenter="0" verticalCenter="0">
  <mx:HDividedBox x="0" y="0" width="100%" height="100%">
   <mx:Canvas width="30%" height="100%" backgroundColor="#FFFFCC">
    <mx:Label x="0" y="10" text="左面组件容器"/>
   </mx:Canvas>
   <mx:Canvas width="70%" height="100%" backgroundColor="#99CCFF">
    <mx:Label x="0" y="10" text="右面组件容器"/>
   </mx:Canvas>
  </mx:HDividedBox>
 </mx:Panel>
</mx:Application>

 

效果图如下所示

 

 

<FONT face=""">

抱歉!评论已关闭.