AIR 開發應用程式實務

918 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
918
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

AIR 開發應用程式實務

  1. 1. AIR 開發應用程式實務洪毓翔 Eia Honghttp://www.facebook.com/angelliya00http://www.plurk.com/angelliya00
  2. 2. AIR是Adobe® AIR® 2.7 執行時期可讓開發人員使用 HTML、JavaScript、Adobe Flash®Professional 與 Flex 技術,以及 ActionScript® 來建立網路應用程式,可當成獨立用戶端應用程式執行,不受瀏覽器的限制 ........很好玩的玩具http://www.adobe.com/tw/products/air/
  3. 3. DemoFWAPhoto Grab
  4. 4. 平台差異- 檔案存取方式: C:// eia@eia-laptop;- 視窗顯示方式: 半透明
  5. 5. 跨平台應用import flash.filesystem.File;File.applicationStorageDirectory — 每個已安裝 AIR 應用程式唯一的儲存目錄File.applicationDirectory — 應用程式安裝位置的唯讀目錄File.desktopDirectory — 使用者的桌面目錄File.documentsDirectory — 使用者的文件目錄File.userDirectory — 使用者目錄 File.urlhttp://help.adobe.com/zh_TW/FlashPlatform/reference/actionscript/3/flash/filesystem/File.html
  6. 6. FileReferencefile = new FileReference();file.download(downloadURL, _fileName+".jpg");
  7. 7. ByteArraytLoader = new PICLoader(); tLoader.name = _downLoadPicArray[i]; tLoader.dataFormat = URLLoaderDataFormat.BINARY; tLoader.addEventListener(Event.COMPLETE, _lh); tLoader.load(new URLRequest(Config.getInstance().picFolder +_downLoadPicArray[i])); trace("Config.getInstance().picFolder + _downLoadPicArray[i]): " +Config.getInstance().picFolder + _downLoadPicArray[i]);var byteArray:ByteArray = evt.target.data as ByteArray var file:File = File[Config.getInstance().filePath]; file = file.resolvePath( "pic/" + evt.target.name ); var wr:File = new File( file.nativePath ); var stream:FileStream = new FileStream(); stream.open( wr , FileMode.WRITE); stream.writeBytes ( byteArray, 0, byteArray.length ); stream.close();
  8. 8. NativeApplication & NativeWindowimport flash.desktop.NativeApplication;NativeApplication.nativeApplication.autoExit = true;NativeApplication.nativeApplication.startAtLogin = true;NativeApplication.nativeApplication.exit();import flash.display.NativeWindow; NativeWindow.close();http://help.adobe.com/zh_TW/FlashPlatform/reference/actionscript/3/flash/desktop/package-detail.htmlhttp://help.adobe.com/zh_TW/FlashPlatform/reference/actionscript/3/flash/display/NativeWindow.html
  9. 9. NativeApplicationautoExit : Booleanexit(errorCode:int = 0):voidadl.exe錯誤(window)
  10. 10. NativeWindowactivate():voidclose():voidmaximize():voidminimize():voidrestore():voidstartMove();
  11. 11. NativeWindowInitOptions////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// var winArgs:NativeWindowInitOptions = new NativeWindowInitOptions(); winArgs.type = NativeWindowType.NORMAL; //winArgs.type = NativeWindowType.UTILITY; //winArgs.type = NativeWindowType.LIGHTWEIGHT; winArgs.systemChrome = NativeWindowSystemChrome.NONE; winArgs.transparent = true; //winArgs.systemChrome = NativeWindowSystemChrome.STANDARD; winArgs.maximizable = false; winArgs.minimizable = false; winArgs.resizable = false; super(winArgs); // stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; stage.nativeWindow.maxSize = new Point(320, 321); activate(); title = "APP-TITLE";//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  12. 12. NativeWindowType.UTILITY;- 一大堆視窗標題- 解決連動,視窗溝通NativeWindowSystemChrome.NONE;winArgs.transparent = true;http://help.adobe.com/zh_TW/AIR/1.1/devappsflash/WS5b3ccc516d4fbf351e63e3d118666ade46-7e09.html
  13. 13. ContextMenu import flash.ui.ContextMenu; import flash.ui.ContextMenuItem;
  14. 14. EncryptedLocalStoreimport flash.data.EncryptedLocalStore;getItem(name:String):ByteArraysetItem(name:String, data:ByteArray, stronglyBound:Boolean =false):voidhttp://help.adobe.com/zh_TW/FlashPlatform/reference/actionscript/3/flash/data/EncryptedLocalStore.html?filter_flash=cs5&filter_flashplayer=10.2&filter_air=2.6
  15. 15. 安全性
  16. 16. 包裝Flash IDEFlashDevelop CreateCertificate.bat PackageApplication.bat
  17. 17. 數位憑證http://help.adobe.com/zh_TW/AIR/1.1/devappsflash/WS5b3ccc516d4fbf351e63e3d118666ade46-7ff0.html
  18. 18. 相關連結使用Adobe Flash CS4 Professional開發Adobe AIR 1.1應用程式http://help.adobe.com/zh_TW/AIR/1.1/devappsflash/PDFhttp://help.adobe.com/zh_TW/AIR/1.1/devappsflash/air_1.1_devappsflash.pdfsamplehttp://www.adobe.com/devnet/air/quick_start_as.htmlhttp://www.adobe.com/devnet/air/flash/quickstart/articles/interacting_window.html
  19. 19. AIR 好好玩THANKS !

×