【来自KSHEN】AIR Beta 2.0与AIR Beta3.0的差异和AIR Beta 3.0新增API

导读:
  如果您觉得界面有些错位,或者想要一个清爽的界面,那么请点击这里
  自从Adobe将AIR由Beta 2.0升级到Beta 3.0(下称Beta 2.0、Beta 3.0),就发现了越来越多的朋友在Beta2.0下面编写的程序,却无法在Beta 3.0下面运行。我在这里总结一下Beta 3.0新增了哪些API?和Beta 2.0与Beta 3.0 之间的差异!
   升级你的Beta 2.0到Beta 3.0的步骤:
  首先需要修改的是application.xml这个文件。
  1、Change xmlns to “http://ns.adobe.com/air/application/1.0.M6”
  2、Added as an element of
  3、Added as an element of
  4、Renamed –> <name> <BR>  5、Renamed <name> –> <filename> <BR>  6、Renamed <handleUpdates> –> <customUpdateUI> and type is xs:boolean <BR>  7、appId was a property within the <application> tag, now is an element tag called <id> <BR>  8、version was a property within the <application> tag, now is an element tag <version> <BR>  <STRONG>一个成型的Beta 3.0的application.xml的描述如下:</STRONG> <BR>  <?xml version="1.0" encoding="utf-8" ?> <BR>  <application xmlns="http://ns.adobe.com/air/application/1.0.M6"> <BR>  <id>SampleApp</id> <BR>  <version>1.2</version> <BR>  <filename>Sample</filename> <BR>  <description>Sample app description</description> <BR>  <copyright>Sample app copyright information</copyright> <BR>  <name>Sample Application </name> <BR>  <initialWindow> <BR>  <title>Main Window
   SampleApplication.swf
   standard
   false
   true
   true
   true
   true
   800
   600
   150
   150
  
  
  
   AIR.TextFile
   aptxt
   AIR Text File
   application/vnd.AIR.text-file
  
   icons/Doc1/txt_16.png
   icons/Doc1/txt_32.png
   icons/Doc1/txt_48.png
   icons/Doc1/txt_128.png
  
  
  
   AIR.ImageFile
   apimg
   AIR Image File
   application/vnd.AIR.image-file
  
   icons/Doc2/ft_16_16.png
   icons/Doc2/ft_32_32.png
   icons/Doc2/ft_48_48.png
   icons/Doc2/ft_128_128.png
  
  
  
  
   Beta 3.0 新增API:(详细的内容请看 Language Reference doc
   New Methods/Properties/Constants
   File
  File.isPackage : Boolean
  File.isSymbolicLink : Boolean
   HTML
  HTMLLoader.textEncodingOverride : String
  HTMLLoader.textEncodingFallback : String
  HTML attribute allowcrossdomainxhr
   Mouse
  MouseEvent.controlKey : Boolean
  MouseEvent.clickCount : int
  MouseEvent.MIDDLE_CLICK
  MouseEvent.MIDDLE_MOUSE_DOWN
  MouseEvent.MIDDLE_MOUSE_UP
   Drag and Drop
  NATIVE_DRAG_UPDATE : String
   Media
  flash.media.scanHardware()
   DRM
  NetStream.resetDRMVouchers()
  NetStream.setDRMAuthentication()
   Security
  flash.securiy.XMLSignatureValidator.useSystemTrustStore : Boolean
  flash.securiy.XMLSignatureValidator.revocationCheckSetting : String
   NativeApplication (formerly Shell)
  NativeApplication.copy()
  NativeApplication.cut()
  NativeApplication.redo()
  NativeApplication.undo()
  NativeApplication.selectAll()
  NativeApplication.performKeyEquivalent()
  NativeApplication.publisherID. publisherID is an empty string when debugging with adl. However, a command line flag in adl allows you to run with a publisherID, and the Flex 3 debugging UI also has a field for you to enter it. Clients can find their publisherID by installing the app and looking at the META-INF/AIR/publisherid file.
   Local SQL DB
  SQLConnection.openAsync()
  SQLError.details
  SQLConnection.cacheSize
  SQLConnection.autoCompact
  SQLConnection.pageSize
  SQLConnection.cacheSize
  SQLMode
   DRM
  DRMErrorEvent (error code related properties from DRMStatusEvent has been migrated to DRMErrorEvent)
   Beta 3.0中去掉的API:
   Removed Methods/Properties/Constants
   URLRequest
  URLRequest.setLoginCredentials() – use URLRequestDefaults.setLoginCredentialsForHost() instead
   Local SQL DB
  SQLStatement.prepare()
  SQLStatement.reset()
  SQLStatement.prepared : Boolean
  SQLEvent.PREPARE
  SQLConnection.getFile()
  SQLConnection.synchronous
  SQLConnection.version
  SQLConnection.caseSensitiveLike
  SQLError.code
   HTML
  window.runtime property for non application HTML pages.
  flash.html.JavaScriptObject, use Object class instead
  flash.html.JavaScriptArray, use Object class instead
  flash.html.JavaScriptFunction, use Object class instead
   NativeWindow
  NativeWindowSystemChrome.UTILITY
  NativeWindowType.MODAL
  NativeWindowInitOptions.hasMenu
   Beta 2.0与Beta 3.0之间的差异性:
   URI Schemes
  “app-resource:” scheme –> “app:” scheme
   File
  FileReference.send() –> FileReference.uploadUnencoded()
  File.applicationResourceDirectory –> File.applicationDirectory
  flash.filesystem.EncryptedLocalStore –> flash.data.EncryptedLocalStore
   Drag and Drop
  DragManager –> NativeDragManager
  DragOptions –> NativeDragOptions
  DragAction –> NativeDragActions
  NativeDragEvent.actionsAllowed : DragOptions –> NativeDragEvent.allowedActions : NativeDragOptions
   Mouse
  MouseEvent.cmdKey : Boolean –> MouseEvent.commandKey : Boolean
  Service Monitor
  ServiceMonitor.lastUpdated –> ServiceMonitor.lastStatusUpdate
  ServiceMonitor.augmentPrototype() –> ServiceMonitor.makeJavascriptSubclass()
   Screen
  Screen.colorDepth : uint –> Screen.colorDepth : int
   NativeApplication (formerly Shell)
  flash.system.Shell –> flash.desktop.NativeApplication
  Shell.isBoundAsDefaultApplication() –> NativeApplication.isSetAsDefaultApplication()
  Shell.bindAsDefaultApplication() –> NativeApplication.setAsDefaultApplication()
  Shell.unbindAsDefaultApplication() –> NativeApplication.removeAsDefaultApplication()
  Shell.id –> NativeApplication.applicationID
  Shell.lastUserInput –> NativeApplication.timeSinceLastUserInput
  Shell.shell –> NativeApplication.nativeApplication
  Shell.startApplicationAtLogin –> NativeApplication.startAtLogin
  Shell.activateApplication –> NativeApplication.activate
   Local SQL DB
  SQLEvent.CLEAN –> SQLEvent.COMPACT
  SQLConnection.clean() –> SQLConnection.compact()
  SQLUpdateEvent.tableName : String –> SQLUpdateEvent.table : String
  SQLConnection.attach(): boolean argument removed
  SQLConnection.SQLConnection(): boolean argument to constructor removed
  The SQLStatement parameters property is now 0-based instead of 1-based. (i.e.: sql.paremeters[1] –> sql.parameters[0]).
   URLRequest
  URLRequestDefaults.shouldAuthenticate –> URLRequestDefaults.authenticate
  URLRequest.shouldAuthenticate –> URLRequest.authenticate
  URLRequestDefaults.shouldCacheResponse –> URLRequestDefaults.cacheResponse
  URLRequest.shouldcacheResponse –> URLRequest.cacheResponse
   URLMonitor
  URLMonitor.acceptableStatuses –> URLMonitor.acceptableStatusCodes
   Updater
  flash.system.Updater –> flash.desktop.Updater
   HTML
  HTMLHost.closeWindow() –> HTMLHost.windowClose()
  HTMLHost.htmlControl –> HTMLHost.htmlLoader
  HTMLControl –> HTMLLoader
  HTMLControl.useApplicationDomain –> HTMLLoader.runtimeApplicationDomain
  HTMLControl.shouldCacheResponse –> HTMLLoader.cacheResponse
  HTMLControl.htmlWidth –> HTMLLoader.contentWidth
  HTMLControl.htmlHeight –> HTMLLoader.contentHeight
  HTMLControl.domInitialize Event –> HTMLLoader.htmlDOMInitialize : Event
  Event.DOM_INITIALIZE –> Event.HTML_DOM_INITIALIZE
  flash.events.HTMLUncaughtJavaScriptExceptionEvent –> flash.events.HTMLUncaughtScriptExceptionEvent
  Javascript API: window.htmlControl ? window.htmlLoader
   EncryptedLocalStore
  EncryptedLocalStore.setItem(name:String, data:ByteArray) –> EncryptedLocalStore.setItem(name:String, data:ByteArray , stronglyBound : Boolean = false)
  以上内容来自:http://labs.adobe.com/wiki/index.php/AIR:Release_Note
   欢迎转载, 不过 请注明:Kenshin Blog和www.k-zone.cn/zblog

本文转自
http://www.k-zone.cn/zblog/post/air-beta2-air-beta3.html
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值