Flex 页面跳转或弹出总结Flex中实现页面的跳转以下几种方式: 1、使用ViewStack组件,把要跳转的页新建成 MXM
Flex 页面跳转或弹出总结
Flex中实现页面的跳转以下几种方式: 1、使用ViewStack组件,把要跳转的页新建成 MXML Component,然后 ...
<mx:ViewStack id="storeViews" width="100%" height="550" creationPolicy="all"> <shouye id="page1" label="page1" showEffect="WipeDown" hideEffect="WipeUp" /> <leixing id="page2" label="page2" showEffect="WipeDown" hideEffect="WipeUp" /> <make id="page3" label="page3" showEffect="WipeDown" hideEffect="WipeUp" /></mx:ViewStack><!-- 然后再用别的组件切换这些页,比如用 Button --><mx:Button click="storeViews.selectedChild=page1;" />
?
2、flash.net.navigateToURL直接页面重定向
?
varrequest:URLRequest = new URLRequest("163.com");navigateToURL(request,"_blank");
?
?
3、flash.external.ExternalInterface调用外部 API
?
ExternalInterface.call("function(){window.location.href='http://163.com';}");
4、弹出页面类mx.managers.PopUpManager之类用PopUpManager的createPopUp方法新建一个组新然后Pop出来PopUpManager.centerPopUp(PopUpManager.createPopUp(this, Comp, true));<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"? creationComplete="init()">?
<mx:Script>???
???? <![CDATA[
??? import mx.managers.PopUpManager; private var vboxw:VBox=new VBox();
??? //这是一打开就弹出来的窗口
??? private function init():void {???
??? PopUpManager.addPopUp(vboxw, this, true);
??? }
??? //这是点击后要弹出的,(注:要求在vboxw后面弹出)
??? private var clikwindos:VBox=new VBox();
??? private function clikup():void
??? {
???? PopUpManager.addPopUp(clikwindos, this, true);//这里怎么设置呢感谢大师帮助.
??? }
??? //还有就是有时场景中会弹出多个窗口,请问最后弹出的窗口能不能加到,已弹出窗口的背面呢谢谢.
?? ]]>???
???? </mx:Script>
<mx:Button label="Launch TitleWindow" click="clikup()" />??
</mx:Application>
5、mx.modules.loadModule方法加载子模块
[javascript] - public?function?jumpTo(toUrl:String):void??{??????????
- ????m1.url=toUrl;?????????m1.loadModule();??????
- }???//其它地方法调用 ??
- this.parentApplication.jumpTo(url);???