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

Flex Mobile开发入门

发布时间:2020-12-15 04:58:03 所属栏目:百科 来源:网络整理
导读:Flex?Mobile开发入门 ? 一、概述 ??? Adobe?AIR(Adobe?Integrated?Runtime),一个跨操作系统的运行时。恩,跨平台的解决方案,和Java虚拟机一样。 ??? 所以呢,运行这些软件,要先装个AIR。好像,QQ农场什么的就需要这个。 ? ??? Flex,软件开发框架,开发
Flex?Mobile开发入门
?
一、概述
??? Adobe?AIR(Adobe?Integrated?Runtime),一个跨操作系统的运行时。恩,跨平台的解决方案,和Java虚拟机一样。
??? 所以呢,运行这些软件,要先装个AIR。好像,QQ农场什么的就需要这个。
?
??? Flex,软件开发框架,开发出的软件即在AIR上运行。支持了Mobile,建工程时有Apple、BlackBerry、Android三平台。
?
>>Adobe?Developer?Connection(Adobe?开发者中心)
英文: http://www.adobe.com/devnet.html
中文: http://www.adobe.com/cn/devnet/
?
二、环境
??? 下个Adobe?Flash?Builder,安装下即可!当前是4.6版本。
?
>>下载地址
英文: https://www.adobe.com/cfusion/tdrc/index.cfm?product=flash_builder
中文: https://www.adobe.com/cfusion/tdrc/index.cfm?product=flash_builder&loc=zh_cn
>>额外参考
http://bbs.9ria.com/thread-107221-1-1.html
?
>>Adobe?Flash?Builder?4.6参考
英文: http://help.adobe.com/en_US/flashbuilder/using/index.html
中文: http://help.adobe.com/zh_CN/flashbuilder/using/index.html
?
三、Android?Flex
??? 简单得找了本入门书籍《Developing?Android?Applications?with?Flex?4.5》,先大概学习看看^^。其中文版下载: http://ishare.iask.sina.com.cn/f/22644465.html。就80页,很快的。
?
??? 附件为该书工程,主要被整理在AndroidFlexSamples。如下:

android flex

?

android flex

?
?其他的,可以看如下的文档:
>>使用ADOBE?FLEX和ADOBE?FLASH?BUILDER开发手机应用程序
??? 官方的,很详细。包括了基础控件、设计什么的。
??? http://help.adobe.com/zh_CN/flex/mobileapps/developing_mobile_apps_flex.pdf
>>?Flex?Mobile?in?Action
??? 新出没多久的书,看了下目录,好像挺不错的。
?
四、AS、mxml什么的
??? 还没系统了解过呢,大概就下面这个样子的:
?
>>AndroidFlexSamples.mxml
?
 
 
  1. <?xml?version="1.0"?encoding="utf-8"?>?
  2. <s:ViewNavigatorApplication?xmlns:fx="http://ns.adobe.com/mxml/2009"?
  3. ????????????????????????????xmlns:s="library://ns.adobe.com/flex/spark"?
  4. ????????????????????????????applicationComplete="appCompleteHandler(event)"?applicationDPI="240"?
  5. ????????????????????????????firstView="views.HomeView"?
  6. ????????????????????????????splashScreenImage="@Embed('assets/android_icon.jpg')"?
  7. ????????????????????????????splashScreenMinimumDisplayTime="3000"?splashScreenScaleMode="letterbox">?
  8. ???? ?
  9. ????<fx:Script>?
  10. ????????<![CDATA[ ?
  11. ????????????import?mx.events.FlexEvent; ?
  12. ????????????import?mx.formatters.DateFormatter; ?
  13. ???????????? ?
  14. ????????????/**?日期格式化对象?*/ ?
  15. ????????????protected?var?df:DateFormatter; ?
  16. ???????????? ?
  17. ????????????/**?返回事件监听者?*/ ?
  18. ????????????private?var?onBackListener:OnBackListener; ?
  19. ???????????? ?
  20. ????????????/**?应用初始化处理?*/ ?
  21. ????????????protected?function?appCompleteHandler(event:FlexEvent):void ?
  22. ????????????{ ?
  23. ????????????????//?初始化日期格式化对象 ?
  24. ????????????????df?=?new?DateFormatter(); ?
  25. ????????????????df.formatString?=?"HH:NN:SS"; ?
  26. ????????????????//?注册键盘事件 ?
  27. ????????????????stage.addEventListener(KeyboardEvent.KEY_DOWN,?onKeyboardHanlder); ?
  28. ????????????} ?
  29. ???????????? ?
  30. ????????????/**?键盘键点击?*/ ?
  31. ????????????private?function?onKeyboardHanlder(event:KeyboardEvent):void ?
  32. ????????????{ ?
  33. ????????????????if(event.keyCode?==?Keyboard.BACK)?{?//?BACK键 ?
  34. ????????????????????backHandler(); ?
  35. ????????????????} ?
  36. ????????????} ?
  37. ???????????? ?
  38. ????????????/**?Home键点击处理?*/ ?
  39. ????????????protected?function?homeBtn_clickHandler(event:MouseEvent):void ?
  40. ????????????{ ?
  41. ????????????????navigator.popToFirstView(); ?
  42. ????????????} ?
  43. ???????????? ?
  44. ????????????/**?Back按钮点击?*/ ?
  45. ????????????protected?function?backBtn_clickHandler(event:MouseEvent):void ?
  46. ????????????{ ?
  47. ????????????????backHandler(); ?
  48. ????????????} ?
  49. ???????????? ?
  50. ????????????/**?返回处理?*/ ?
  51. ????????????private?function?backHandler():void ?
  52. ????????????{ ?
  53. ????????????????if?(navigator.length?>?1)?{ ?
  54. ????????????????????if?(onBackListener?!=?null)?{ ?
  55. ????????????????????????onBackListener.onBackHandler(); ?
  56. ????????????????????} ?
  57. ????????????????????navigator.popView(); ?
  58. ????????????????}?else?{ ?
  59. ????????????????????NativeApplication.nativeApplication.exit(); ?
  60. ????????????????} ?
  61. ????????????} ?
  62. ???????????? ?
  63. ????????????/**?格式化时间?*/ ?
  64. ????????????public?function?formatTime():String ?
  65. ????????????{ ?
  66. ????????????????return?df.format(new?Date()); ?
  67. ????????????} ?
  68. ???????????? ?
  69. ????????????/**?设置返回事件监听者?*/ ?
  70. ????????????public?function?setOnBackListener(onBackListener:OnBackListener):void ?
  71. ????????????{ ?
  72. ????????????????this.onBackListener?=?onBackListener; ?
  73. ????????????} ?
  74. ???????????? ?
  75. ????????]]>?
  76. ????</fx:Script>?
  77. ????<fx:Declarations>?
  78. ????????<!--?Place?non-visual?elements?(e.g.,?services,?value?objects)?here?-->?
  79. ????</fx:Declarations>?
  80. ????<s:navigationContent>?
  81. ????????<s:Button?id="homeBtn"?label="Home"?click="homeBtn_clickHandler(event)"/>?
  82. ????</s:navigationContent>?
  83. ????<s:actionContent>?
  84. ????????<s:Button?id="backBtn"?label="Back"?click="backBtn_clickHandler(event)"/>?
  85. ????</s:actionContent>?
  86. </s:ViewNavigatorApplication>?
?
??? ActionScript可以看如下手册学习:
>>FlashCS3简体中文帮助文档
http://ishare.iask.sina.com.cn/f/23955540.html(重新搜的,看大小应该是这个)
?
五、后记
??? 这些看完,基础也就差不多了吧^^。恩,官方中英文档很多,遇到什么其他的可以去哪里看。

(编辑:李大同)

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

    推荐文章
      热点阅读