【来自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 <allowbrowserinvocation> as an element of <application><br>  3、Added <icon> as an element of <filetype><br>  4、Renamed <title> –&gt; <name><br>  5、Renamed <name> –&gt; <filename><br>  6、Renamed <handleupdates> –&gt; <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</title> <br>  <content>SampleApplication.swf</content><br>  <systemchrome>standard</systemchrome><br>  <transparent>false</transparent><br>  <visible>true</visible><br>  <minimizable>true</minimizable><br>  <maximizable>true</maximizable><br>  <resizable>true</resizable><br>  <width>800</width><br>  <height>600</height><br>  <x>150</x><br>  <y>150</y><br>  </initialwindow><br>  <filetypes><br>  <filetype><br>  <name>AIR.TextFile</name><br>  <extension>aptxt</extension><br>  <description>AIR Text File</description><br>  <contenttype>application/vnd.AIR.text-file</contenttype><br>  <icon><br>  <image16x16>icons/Doc1/txt_16.png</image16x16><br>  <image32x32>icons/Doc1/txt_32.png</image32x32><br>  <image48x48>icons/Doc1/txt_48.png</image48x48><br>  <image128x128>icons/Doc1/txt_128.png</image128x128><br>  </icon><br>  </filetype><br>  <filetype><br>  <name>AIR.ImageFile</name><br>  <extension>apimg</extension><br>  <description>AIR Image File</description><br>  <contenttype>application/vnd.AIR.image-file</contenttype><br>  <icon><br>  <image16x16>icons/Doc2/ft_16_16.png</image16x16><br>  <image32x32>icons/Doc2/ft_32_32.png</image32x32><br>  <image48x48>icons/Doc2/ft_48_48.png</image48x48><br>  <image128x128>icons/Doc2/ft_128_128.png</image128x128><br>  </icon><br>  </filetype><br>  </filetypes><br>  </application><br>  <strong>Beta 3.0 新增API:(详细的内容请看</strong><strong>Language Reference doc</strong><strong>)</strong> <br>  <strong>New Methods/Properties/Constants</strong> <br>  <strong>File</strong> <br>  File.isPackage : Boolean <br>  File.isSymbolicLink : Boolean <br>  <strong>HTML</strong> <br>  HTMLLoader.textEncodingOverride : String <br>  HTMLLoader.textEncodingFallback : String <br>  HTML <frame> attribute allowcrossdomainxhr <br>  <strong>Mouse</strong> <br>  MouseEvent.controlKey : Boolean <br>  MouseEvent.clickCount : int <br>  MouseEvent.MIDDLE_CLICK <br>  MouseEvent.MIDDLE_MOUSE_DOWN <br>  MouseEvent.MIDDLE_MOUSE_UP <br>  <strong>Drag and Drop</strong> <br>  NATIVE_DRAG_UPDATE : String <br>  <strong>Media</strong> <br>  flash.media.scanHardware() <br>  <strong>DRM</strong> <br>  NetStream.resetDRMVouchers() <br>  NetStream.setDRMAuthentication() <br>  <strong>Security</strong> <br>  flash.securiy.XMLSignatureValidator.useSystemTrustStore : Boolean <br>  flash.securiy.XMLSignatureValidator.revocationCheckSetting : String <br>  <strong>NativeApplication (formerly Shell)</strong> <br>  NativeApplication.copy() <br>  NativeApplication.cut() <br>  NativeApplication.redo() <br>  NativeApplication.undo() <br>  NativeApplication.selectAll() <br>  NativeApplication.performKeyEquivalent() <br>  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. <br>  <strong>Local SQL DB</strong> <br>  SQLConnection.openAsync() <br>  SQLError.details <br>  SQLConnection.cacheSize <br>  SQLConnection.autoCompact <br>  SQLConnection.pageSize <br>  SQLConnection.cacheSize <br>  SQLMode <br>  <strong>DRM</strong> <br>  DRMErrorEvent (error code related properties from DRMStatusEvent has been migrated to DRMErrorEvent) <br>  <strong>Beta 3.0中去掉的API:</strong> <br>  <strong>Removed Methods/Properties/Constants</strong> <br>  <strong>URLRequest</strong> <br>  URLRequest.setLoginCredentials() – use URLRequestDefaults.setLoginCredentialsForHost() instead <br>  <strong>Local SQL DB</strong> <br>  SQLStatement.prepare() <br>  SQLStatement.reset() <br>  SQLStatement.prepared : Boolean <br>  SQLEvent.PREPARE <br>  SQLConnection.getFile() <br>  SQLConnection.synchronous <br>  SQLConnection.version <br>  SQLConnection.caseSensitiveLike <br>  SQLError.code <br>  <strong>HTML</strong> <br>  window.runtime property for non application HTML pages. <br>  flash.html.JavaScriptObject, use Object class instead <br>  flash.html.JavaScriptArray, use Object class instead <br>  flash.html.JavaScriptFunction, use Object class instead <br>  <strong>NativeWindow</strong> <br>  NativeWindowSystemChrome.UTILITY <br>  NativeWindowType.MODAL <br>  NativeWindowInitOptions.hasMenu <br>  <strong>Beta 2.0与Beta 3.0之间的差异性:</strong> <br>  <strong>URI Schemes</strong> <br>  “app-resource:” scheme –&gt; “app:” scheme <br>  <strong>File</strong> <br>  FileReference.send() –&gt; FileReference.uploadUnencoded() <br>  File.applicationResourceDirectory –&gt; File.applicationDirectory <br>  flash.filesystem.EncryptedLocalStore –&gt; flash.data.EncryptedLocalStore <br>  <strong>Drag and Drop</strong> <br>  DragManager –&gt; NativeDragManager <br>  DragOptions –&gt; NativeDragOptions <br>  DragAction –&gt; NativeDragActions <br>  NativeDragEvent.actionsAllowed : DragOptions –&gt; NativeDragEvent.allowedActions : NativeDragOptions <br>  <strong>Mouse</strong> <br>  MouseEvent.cmdKey : Boolean –&gt; MouseEvent.commandKey : Boolean <br>  Service Monitor <br>  ServiceMonitor.lastUpdated –&gt; ServiceMonitor.lastStatusUpdate <br>  ServiceMonitor.augmentPrototype() –&gt; ServiceMonitor.makeJavascriptSubclass() <br>  <strong>Screen</strong> <br>  Screen.colorDepth : uint –&gt; Screen.colorDepth : int <br>  <strong>NativeApplication (formerly Shell)</strong> <br>  flash.system.Shell –&gt; flash.desktop.NativeApplication <br>  Shell.isBoundAsDefaultApplication() –&gt; NativeApplication.isSetAsDefaultApplication() <br>  Shell.bindAsDefaultApplication() –&gt; NativeApplication.setAsDefaultApplication() <br>  Shell.unbindAsDefaultApplication() –&gt; NativeApplication.removeAsDefaultApplication() <br>  Shell.id –&gt; NativeApplication.applicationID <br>  Shell.lastUserInput –&gt; NativeApplication.timeSinceLastUserInput <br>  Shell.shell –&gt; NativeApplication.nativeApplication <br>  Shell.startApplicationAtLogin –&gt; NativeApplication.startAtLogin <br>  Shell.activateApplication –&gt; NativeApplication.activate <br>  <strong>Local SQL DB</strong> <br>  SQLEvent.CLEAN –&gt; SQLEvent.COMPACT <br>  SQLConnection.clean() –&gt; SQLConnection.compact() <br>  SQLUpdateEvent.tableName : String –&gt; SQLUpdateEvent.table : String <br>  SQLConnection.attach(): boolean argument removed <br>  SQLConnection.SQLConnection(): boolean argument to constructor removed <br>  The SQLStatement parameters property is now 0-based instead of 1-based. (i.e.: sql.paremeters[1] –&gt; sql.parameters[0]). <br>  <strong>URLRequest</strong> <br>  URLRequestDefaults.shouldAuthenticate –&gt; URLRequestDefaults.authenticate <br>  URLRequest.shouldAuthenticate –&gt; URLRequest.authenticate <br>  URLRequestDefaults.shouldCacheResponse –&gt; URLRequestDefaults.cacheResponse <br>  URLRequest.shouldcacheResponse –&gt; URLRequest.cacheResponse <br>  <strong>URLMonitor</strong> <br>  URLMonitor.acceptableStatuses –&gt; URLMonitor.acceptableStatusCodes <br>  <strong>Updater</strong> <br>  flash.system.Updater –&gt; flash.desktop.Updater <br>  <strong>HTML</strong> <br>  HTMLHost.closeWindow() –&gt; HTMLHost.windowClose() <br>  HTMLHost.htmlControl –&gt; HTMLHost.htmlLoader <br>  HTMLControl –&gt; HTMLLoader <br>  HTMLControl.useApplicationDomain –&gt; HTMLLoader.runtimeApplicationDomain <br>  HTMLControl.shouldCacheResponse –&gt; HTMLLoader.cacheResponse <br>  HTMLControl.htmlWidth –&gt; HTMLLoader.contentWidth <br>  HTMLControl.htmlHeight –&gt; HTMLLoader.contentHeight <br>  HTMLControl.domInitialize Event –&gt; HTMLLoader.htmlDOMInitialize : Event <br>  Event.DOM_INITIALIZE –&gt; Event.HTML_DOM_INITIALIZE <br>  flash.events.HTMLUncaughtJavaScriptExceptionEvent –&gt; flash.events.HTMLUncaughtScriptExceptionEvent <br>  Javascript API: window.htmlControl ? window.htmlLoader <br>  <strong>EncryptedLocalStore</strong> <br>  EncryptedLocalStore.setItem(name:String, data:ByteArray) –&gt; EncryptedLocalStore.setItem(name:String, data:ByteArray , stronglyBound : Boolean = false) <br>  以上内容来自:http://labs.adobe.com/wiki/index.php/AIR:Release_Note <br>  <strong>欢迎转载,</strong><strong>不过</strong><strong>请注明</strong>:Kenshin Blog和www.k-zone.cn/zblog <br><br>本文转自 <br><a href="http://www.k-zone.cn/zblog/post/air-beta2-air-beta3.html">http://www.k-zone.cn/zblog/post/air-beta2-air-beta3.html</a></version></application></id></application></customupdateui></handleupdates></filename></name></name> </title></filetype></icon></application></allowbrowserinvocation>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值