Flex Mobile开发入门
 
一、概述
    Adobe AIR(Adobe Integrated Runtime),一个跨操作系统的运行时。恩,跨平台的解决方案,和Java虚拟机一样。
    所以呢,运行这些软件,要先装个AIR。好像,QQ农场什么的就需要这个。
 
    Flex,软件开发框架,开发出的软件即在AIR上运行。支持了Mobile,建工程时有Apple、BlackBerry、Android三平台。
 
>>Adobe Developer Connection(Adobe 开发者中心)
 
二、环境
    下个Adobe Flash Builder,安装下即可!当前是4.6版本。
 
>>下载地址
>>额外参考
 
>>Adobe Flash Builder 4.6参考
 
三、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开发手机应用程序
    官方的,很详细。包括了基础控件、设计什么的。
>> 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(重新搜的,看大小应该是这个)
 
五、后记
    这些看完,基础也就差不多了吧^^。恩,官方中英文档很多,遇到什么其他的可以去哪里看。