导读:
如果您觉得界面有些错位,或者想要一个清爽的界面,那么请点击这里
自从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> –> <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</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 –> “app:” scheme <br> <strong>File</strong> <br> FileReference.send() –> FileReference.uploadUnencoded() <br> File.applicationResourceDirectory –> File.applicationDirectory <br> flash.filesystem.EncryptedLocalStore –> flash.data.EncryptedLocalStore <br> <strong>Drag and Drop</strong> <br> DragManager –> NativeDragManager <br> DragOptions –> NativeDragOptions <br> DragAction –> NativeDragActions <br> NativeDragEvent.actionsAllowed : DragOptions –> NativeDragEvent.allowedActions : NativeDragOptions <br> <strong>Mouse</strong> <br> MouseEvent.cmdKey : Boolean –> MouseEvent.commandKey : Boolean <br> Service Monitor <br> ServiceMonitor.lastUpdated –> ServiceMonitor.lastStatusUpdate <br> ServiceMonitor.augmentPrototype() –> ServiceMonitor.makeJavascriptSubclass() <br> <strong>Screen</strong> <br> Screen.colorDepth : uint –> Screen.colorDepth : int <br> <strong>NativeApplication (formerly Shell)</strong> <br> flash.system.Shell –> flash.desktop.NativeApplication <br> Shell.isBoundAsDefaultApplication() –> NativeApplication.isSetAsDefaultApplication() <br> Shell.bindAsDefaultApplication() –> NativeApplication.setAsDefaultApplication() <br> Shell.unbindAsDefaultApplication() –> NativeApplication.removeAsDefaultApplication() <br> Shell.id –> NativeApplication.applicationID <br> Shell.lastUserInput –> NativeApplication.timeSinceLastUserInput <br> Shell.shell –> NativeApplication.nativeApplication <br> Shell.startApplicationAtLogin –> NativeApplication.startAtLogin <br> Shell.activateApplication –> NativeApplication.activate <br> <strong>Local SQL DB</strong> <br> SQLEvent.CLEAN –> SQLEvent.COMPACT <br> SQLConnection.clean() –> SQLConnection.compact() <br> SQLUpdateEvent.tableName : String –> 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] –> sql.parameters[0]). <br> <strong>URLRequest</strong> <br> URLRequestDefaults.shouldAuthenticate –> URLRequestDefaults.authenticate <br> URLRequest.shouldAuthenticate –> URLRequest.authenticate <br> URLRequestDefaults.shouldCacheResponse –> URLRequestDefaults.cacheResponse <br> URLRequest.shouldcacheResponse –> URLRequest.cacheResponse <br> <strong>URLMonitor</strong> <br> URLMonitor.acceptableStatuses –> URLMonitor.acceptableStatusCodes <br> <strong>Updater</strong> <br> flash.system.Updater –> flash.desktop.Updater <br> <strong>HTML</strong> <br> HTMLHost.closeWindow() –> HTMLHost.windowClose() <br> HTMLHost.htmlControl –> HTMLHost.htmlLoader <br> HTMLControl –> HTMLLoader <br> HTMLControl.useApplicationDomain –> HTMLLoader.runtimeApplicationDomain <br> HTMLControl.shouldCacheResponse –> HTMLLoader.cacheResponse <br> HTMLControl.htmlWidth –> HTMLLoader.contentWidth <br> HTMLControl.htmlHeight –> HTMLLoader.contentHeight <br> HTMLControl.domInitialize Event –> HTMLLoader.htmlDOMInitialize : Event <br> Event.DOM_INITIALIZE –> Event.HTML_DOM_INITIALIZE <br> flash.events.HTMLUncaughtJavaScriptExceptionEvent –> flash.events.HTMLUncaughtScriptExceptionEvent <br> Javascript API: window.htmlControl ? window.htmlLoader <br> <strong>EncryptedLocalStore</strong> <br> EncryptedLocalStore.setItem(name:String, data:ByteArray) –> 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>
如果您觉得界面有些错位,或者想要一个清爽的界面,那么请点击这里
自从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> –> <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</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 –> “app:” scheme <br> <strong>File</strong> <br> FileReference.send() –> FileReference.uploadUnencoded() <br> File.applicationResourceDirectory –> File.applicationDirectory <br> flash.filesystem.EncryptedLocalStore –> flash.data.EncryptedLocalStore <br> <strong>Drag and Drop</strong> <br> DragManager –> NativeDragManager <br> DragOptions –> NativeDragOptions <br> DragAction –> NativeDragActions <br> NativeDragEvent.actionsAllowed : DragOptions –> NativeDragEvent.allowedActions : NativeDragOptions <br> <strong>Mouse</strong> <br> MouseEvent.cmdKey : Boolean –> MouseEvent.commandKey : Boolean <br> Service Monitor <br> ServiceMonitor.lastUpdated –> ServiceMonitor.lastStatusUpdate <br> ServiceMonitor.augmentPrototype() –> ServiceMonitor.makeJavascriptSubclass() <br> <strong>Screen</strong> <br> Screen.colorDepth : uint –> Screen.colorDepth : int <br> <strong>NativeApplication (formerly Shell)</strong> <br> flash.system.Shell –> flash.desktop.NativeApplication <br> Shell.isBoundAsDefaultApplication() –> NativeApplication.isSetAsDefaultApplication() <br> Shell.bindAsDefaultApplication() –> NativeApplication.setAsDefaultApplication() <br> Shell.unbindAsDefaultApplication() –> NativeApplication.removeAsDefaultApplication() <br> Shell.id –> NativeApplication.applicationID <br> Shell.lastUserInput –> NativeApplication.timeSinceLastUserInput <br> Shell.shell –> NativeApplication.nativeApplication <br> Shell.startApplicationAtLogin –> NativeApplication.startAtLogin <br> Shell.activateApplication –> NativeApplication.activate <br> <strong>Local SQL DB</strong> <br> SQLEvent.CLEAN –> SQLEvent.COMPACT <br> SQLConnection.clean() –> SQLConnection.compact() <br> SQLUpdateEvent.tableName : String –> 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] –> sql.parameters[0]). <br> <strong>URLRequest</strong> <br> URLRequestDefaults.shouldAuthenticate –> URLRequestDefaults.authenticate <br> URLRequest.shouldAuthenticate –> URLRequest.authenticate <br> URLRequestDefaults.shouldCacheResponse –> URLRequestDefaults.cacheResponse <br> URLRequest.shouldcacheResponse –> URLRequest.cacheResponse <br> <strong>URLMonitor</strong> <br> URLMonitor.acceptableStatuses –> URLMonitor.acceptableStatusCodes <br> <strong>Updater</strong> <br> flash.system.Updater –> flash.desktop.Updater <br> <strong>HTML</strong> <br> HTMLHost.closeWindow() –> HTMLHost.windowClose() <br> HTMLHost.htmlControl –> HTMLHost.htmlLoader <br> HTMLControl –> HTMLLoader <br> HTMLControl.useApplicationDomain –> HTMLLoader.runtimeApplicationDomain <br> HTMLControl.shouldCacheResponse –> HTMLLoader.cacheResponse <br> HTMLControl.htmlWidth –> HTMLLoader.contentWidth <br> HTMLControl.htmlHeight –> HTMLLoader.contentHeight <br> HTMLControl.domInitialize Event –> HTMLLoader.htmlDOMInitialize : Event <br> Event.DOM_INITIALIZE –> Event.HTML_DOM_INITIALIZE <br> flash.events.HTMLUncaughtJavaScriptExceptionEvent –> flash.events.HTMLUncaughtScriptExceptionEvent <br> Javascript API: window.htmlControl ? window.htmlLoader <br> <strong>EncryptedLocalStore</strong> <br> EncryptedLocalStore.setItem(name:String, data:ByteArray) –> 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>