加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

flex 页面跳转

发布时间:2020-12-15 04:05:09 所属栏目:百科 来源:网络整理
导读:demo:https://github.com/victoryckl/flex-demos/tree/master/pagejump ? http://www.voidcn.com/article/p-beodugpi-wg.html 一般有两种比较好的方式:"States" and "viewStack" [xhtml] ? view plain copy ? xml ? version = "1.0" ? encoding = "utf-8" ?

demo:https://github.com/victoryckl/flex-demos/tree/master/pagejump

?

http://www.voidcn.com/article/p-beodugpi-wg.html

一般有两种比较好的方式:"States" and "viewStack"

[xhtml] ? view plain copy
  1. <?xml?version="1.0"?encoding="utf-8"?>??
  2. <mx:Application?xmlns:mx="http://www.adobe.com/2006/mxml"?xmlns:view="view.*"???
  3. ????????creationComplete="initApp()"?horizontalAlign="center"?verticalAlign="middle">??
  4. ??????????????????
  5. ????????<mx:Style?source="style.css"?/>??
  6. ??????????
  7. ????????<mx:Script>??
  8. ????????????????<!--[CDATA[??
  9. ????????????????????????import?flash.events.Event??
  10. ????????????????????????import?mx.managers.CursorManager??
  11. ????????????????????????import?model.ModelLocator??
  12. ??????????????????????????
  13. ????????????????????????import?mx.controls.Alert??
  14. ????????????????????????private?var?instance:ModelLocator?=?ModelLocator.getInstance();??
  15. ????????????????????????internal?function?initApp():void{??
  16. ????????????????????????????????currentState="Login";??
  17. ??????????????????????????????????
  18. ????????????????????????????????instance.addEventListener(ModelLocator.LOGIN_OK,onLoginHandler)??
  19. ????????????????????????????????instance.addEventListener(ModelLocator.LOGIN_FAILED,onLoginFailHandler)??
  20. ????????????????????????}??
  21. ????????????????????????internal?function?onLoginHandler(evt:Event):void{??
  22. ????????????????????????????????currentState="Main";??
  23. ????????????????????????}??
  24. ????????????????????????internal?function?onLoginFailHandler(evt:Event):void{??
  25. ????????????????????????????????Alert.show("登陆失败,请重新输入!","密码错了!")??
  26. ????????????????]]-->??
  27. ????????</mx:Script>??
  28. ????????<mx:states>??????????
  29. ????????????????<!--?login?state?-->??
  30. ????????????????<mx:State?name="Login">??
  31. ????????????????????????<mx:AddChild?position="lastChild">??
  32. ????????????????????????????????<view:loginPanel?id="loginPanel"/>??
  33. ????????????????????????</mx:AddChild>??
  34. ????????????????</mx:State>??
  35. ????????????????<!--?Main?state?-->??
  36. ????????????????<mx:State?name="Main">??
  37. ????????????????????????<mx:AddChild?position="lastChild">??
  38. ????????????????????????????????<view:main?id="mainApp"?/>??
  39. ????????????????????????</mx:AddChild>??
  40. ????????????????</mx:State>??????????????????
  41. ????????</mx:states>??
  42. ?????????<mx:transitions>??
  43. ????????<mx:Transition?fromState="*"?toState="*">??
  44. ????????????????<mx:Iris?xFrom="10"??targets="{[loginPanel,?mainApp]}"/>??
  45. ????????</mx:Transition>??
  46. ????????</mx:transitions>??
  47. ????????<mx:ApplicationControlBar?dock="true"?fillAlphas="[0.2,?0.7]"?>??
  48. ????????????????<mx:Label?text="名片管理"?/>??
  49. ????????????????<mx:Spacer?width="100%"?/>??
  50. ????????????????<mx:Label?id="txtWelcome"?visible="false"?/>??
  51. ????????</mx:ApplicationControlBar>??????????
  52. </mx:Application>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读