Flex中實現頁面的跳轉以下幾種方式

來源:互聯網
上載者:User

 

 

 

Flex中實現頁面的跳轉以下幾種方式:

   1、使用ViewStack組件,把要跳轉的頁建立成 MXML Component,然後通過 ViewStack 組件把

這些頁包含進來,然後再通過改變ViewStack的selectedItem或者selectedChild來切換這些頁。

   2、使用navigateToURL,主要方式如下:

        var url:String = "http://localhost:8080/Flex_Java_Demo/welcome.html";
        var request:URLRequest = new URLRequest(url);
        navigateToURL(request,"_blank");

        這個方法頁面切換時會彈出新的頁面,而不是只變換 url

   3、引用flash中的 import flash.external.ExternalInterface 這個介面,

        它能提供像jsp中window.location.href方法一樣方便,主要代碼為:
        ExternalInterface.call("function(){window.location.href=

                                          'http://localhost:8080/Flex_J2eeDemo/bin/Welcome.html';}");

   4、使用組件技術,把不同的頁面做成component,然後通過TabNavigator等進行切換,通過使用state實現跳轉。

   5、把不同的頁面做成Module,然後使用ModuleLoder來進行載入切換。

 

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.