-
公告
-
跟随我
-
订阅我
-
关注一下
-
订阅、收藏、分享
-
最新文章
-
最新评论
-
反向链接
[AIR]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>
3、Added <icon> as an element of <fileType>
4、Renamed <title> –> <name>
5、Renamed <name> –> <filename>
6、Renamed <handleUpdates> –> <customUpdateUI> and type is xs:boolean
7、appId was a property within the <application> tag, now is an element tag called <id>
8、version was a property within the <application> tag, now is an element tag <version>
一个成型的Beta 3.0的application.xml的描述如下:
<?xml version="1.0" encoding="utf-8" ?>
<application xmlns="http://ns.adobe.com/air/application/1.0.M6">
<id>SampleApp</id>
<version>1.2</version>
<filename>Sample</filename>
<description>Sample app description</description>
<copyright>Sample app copyright information</copyright>
<name>Sample Application </name>
<initialWindow>
<title>Main Window</title>
<content>SampleApplication.swf</content>
<systemChrome>standard</systemChrome>
<transparent>false</transparent>
<visible>true</visible>
<minimizable>true</minimizable>
<maximizable>true</maximizable>
<resizable>true</resizable>
<width>800</width>
<height>600</height>
<x>150</x>
<y>150</y>
</initialWindow>
<fileTypes>
<fileType>
<name>AIR.TextFile</name>
<extension>aptxt</extension>
<description>AIR Text File</description>
<contentType>application/vnd.AIR.text-file</contentType>
<icon>
<image16x16>icons/Doc1/txt_16.png</image16x16>
<image32x32>icons/Doc1/txt_32.png</image32x32>
<image48x48>icons/Doc1/txt_48.png</image48x48>
<image128x128>icons/Doc1/txt_128.png</image128x128>
</icon>
</fileType>
<fileType>
<name>AIR.ImageFile</name>
<extension>apimg</extension>
<description>AIR Image File</description>
<contentType>application/vnd.AIR.image-file</contentType>
<icon>
<image16x16>icons/Doc2/ft_16_16.png</image16x16>
<image32x32>icons/Doc2/ft_32_32.png</image32x32>
<image48x48>icons/Doc2/ft_48_48.png</image48x48>
<image128x128>icons/Doc2/ft_128_128.png</image128x128>
</icon>
</fileType>
</fileTypes>
</application>
Beta 3.0 新增API:(详细的内容请看Language Reference doc)
New Methods/Properties/Constants
File.isSymbolicLink : Boolean
HTML
HTMLLoader.textEncodingFallback : String
HTML <frame> attribute allowcrossdomainxhr
Mouse
MouseEvent.clickCount : int
MouseEvent.MIDDLE_CLICK
MouseEvent.MIDDLE_MOUSE_DOWN
MouseEvent.MIDDLE_MOUSE_UP
Drag and Drop
Media
DRM
NetStream.setDRMAuthentication()
Security
flash.securiy.XMLSignatureValidator.revocationCheckSetting : String
NativeApplication (formerly Shell)
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
SQLError.details
SQLConnection.cacheSize
SQLConnection.autoCompact
SQLConnection.pageSize
SQLConnection.cacheSize
SQLMode
DRM
Beta 3.0中去掉的API:
Removed Methods/Properties/Constants
URLRequest
Local SQL DB
SQLStatement.reset()
SQLStatement.prepared : Boolean
SQLEvent.PREPARE
SQLConnection.getFile()
SQLConnection.synchronous
SQLConnection.version
SQLConnection.caseSensitiveLike
SQLError.code
HTML
flash.html.JavaScriptObject, use Object class instead
flash.html.JavaScriptArray, use Object class instead
flash.html.JavaScriptFunction, use Object class instead
NativeWindow
NativeWindowType.MODAL
NativeWindowInitOptions.hasMenu
Beta 2.0与Beta 3.0之间的差异性:
URI Schemes
File
File.applicationResourceDirectory –> File.applicationDirectory
flash.filesystem.EncryptedLocalStore –> flash.data.EncryptedLocalStore
Drag and Drop
DragOptions –> NativeDragOptions
DragAction –> NativeDragActions
NativeDragEvent.actionsAllowed : DragOptions –> NativeDragEvent.allowedActions : NativeDragOptions
Mouse
Service Monitor
ServiceMonitor.augmentPrototype() –> ServiceMonitor.makeJavascriptSubclass()
Screen
NativeApplication (formerly Shell)
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
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
URLRequest.shouldAuthenticate –> URLRequest.authenticate
URLRequestDefaults.shouldCacheResponse –> URLRequestDefaults.cacheResponse
URLRequest.shouldcacheResponse –> URLRequest.cacheResponse
URLMonitor
Updater
HTML
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
以上内容来自:http://labs.adobe.com/wiki/index.php/AIR:Release_Note
欢迎转载,不过请注明:Kenshin Blog和www.k-zone.cn/zblog










1 Comments , 0 Trackbacks
Jump to comment form | comments rss | Get trackback uri