哈哈。。。很开心。。。找到了这份资料!~~~~
======================================================================
尽管 Flash Lite 2.0 已经就快出来了,但是,掌握一些 Flash Lite 1.1 的基础知识还是很必要的,对手机 Flash 应用的开发者来说,等到 Flash Lite 2.0 再动手并不是一个最好的选择,能掌握先机是很重要的。 这些资料其实是从 Flash Lite 1.1 的文档翻译来的,是为了今后查找的时候更方便一些而已。这些功能并不是所有手机都会支持,需要上机测试才能了解是否支持。
Flash Lite 1.1 目前支持功能相对较强的 FSCommand2,这在普通的 FLash 播放器中是不支持的。相对 FSCommand,有如下的不同:
FSCommand2 可以使用任意多的参数; FSCommand2 在动画中被立即执行,而 FSCommand 则是在一帧结束后才执行; FSCommand2 可以有返回值,以便判断是否成功。 FSCommand2 主要分成三类:普通指令、控制影片播放的指令、平台相关指令。下面是详细内容:
普通指令
普通指令::URL 编码相关
Escape
status = FSCommand2( “Escape”, original, encoded ) URL 编码指令,将 original 编码成 encoded。 返回 0 失败,返回 1 成功。
Example: original_string = “hello, how are you?”; status = fscommand2(”Escape”, original_string, “encoded_string”);
Unescape
status = FSCommand2( “Unescape”, encoded, original ) URL 解码指令,将 encoded 解码成 original。 返回 0 失败,返回 1 成功。
Example: string2 = “Hello%7B%5BWorld%5D%7D”; status = fscommand2(”Unescape”, string2, “normal_string”);
普通指令::输入框相关
SetInputTextType()
status = FSCommand2( “SetInputTextType”, variableName, type ) 设定文本框可输入文本的类型,variableName 是对应的文本框内的值,type 则由以下内容控制: Numeric: [0-9]; Alpha: [A-Z, a-z]; Alphanumeric: [0-9, A-Z, a-z]; Latin: 拉丁符号; NonLatin: 非拉丁符号; NoRestriction: 默认模式。 返回 0 失败,返回 1 成功。
Example: status = fscommand2(”SetInputTextType”, “input1″, “Numeric”);
控制影片播放的指令
控制影片播放的指令::显示
FullScreen()
status = FSCommand2( “FullScreen”, size ) 设置全屏播放模式,size 应该为 true 或者 false。 返回 -1 为不支持,0 则为支持。 某些手机不支持全屏播放模式。
SetQuality()
status = FSCommand2( “SetQuality”, quality ) 设置动画播放的质量,quality 的值为 high,medium 或 low。 返回 -1 为不支持,0 则为支持。
控制影片播放的指令::键盘设置
SetSoftKeys()
status = FSCommand2( “SetSoftkeys”, left, right ) 设置手机上左右两个软键的功能显示内容,left 和 right 可以是变量或者字符串。按下左键的时候激活的是 PageUp 事件,而右键则是 PageDown 事件。 返回 -1 为不支持,0 则为支持。
ResetSoftKeys()
status = FSCommand2( “ResetSoftKeys” ) 重置左右软键。 返回 -1 为不支持,0 则为支持。
播放器操作指令
GetFreePlayerMemory()
status = FSCommand2( “GetFreePlayerMemory” ) 获得剩余内存数,以 K 为单位。 返回 -1 为不支持,其它值则为剩余的内存,以 K 为单位。
GetTotalPlayerMemory()
status = FSCommand2( “GetTotalPlayerMemory” ) 获得 Flash Lite 可使用的内存总数,以 K 为单位。 返回 -1 为不支持,其它值则为内存数,以 K 为单位。
Launch()
status = FSCommand( “Launch”, “application-path,arg1,arg2,…,argn” ) 执行手机上的其它应用程序(操作系统无关)。
Quit()
status = FSCommand2( “Quit” ) 退出当前的 Flash Lite 程序。 返回 -1 为不支持。
平台相关指令
平台相关指令::日期和时间
GetDateDay()
status = FSCommand2( “GetDateDay” ) 获得当前的日期(1-31)。 返回 -1 为不支持,支持则返回 1-31 之间的数字。
GetDateMonth()
status = FSCommand2( “GetDateMonth” ) 获得当前的月份(1-12)。 返回 -1 为不支持,支持则返回 1-12 之间的数字。
GetDateWeekday()
status = FSCommand2( “GetDateWeekday” ) 获得当前的月份(0-6)。 返回 -1 为不支持,支持则返回 0-6 之间的数字。
GetDateYear()
status = FSCommand2( “GetDateYear” ) 获得当前的年份。 返回 -1 为不支持,支持则返回数字,如:2005。
GetLocaleLongDate()
status = FSCommand2( “GetLocaleLongDate”, “longdate” ) 获取当前的长日期串。日期格式根据手机本身以及 Locale 来确定。日期值指向到一个字串。 返回 -1 为不支持,0 则为支持。 以下是两个返回的 longdate 的例子: October 16, 2004 16 October 2004
GetLocaleShortDate()
status = FSCommand2( “GetLocaleShortDate”, “shortdate” ) 获取当前的短日期串。日期格式根据手机本身以及 Locale 来确定。日期值指向到一个字串。 返回 -1 为不支持,0 则为支持。 以下是两个返回的 shortdate 的例子: 10/16/2004 16-10-2004
GetLocaleTime()
status = FSCommand2( “GetLocalTime”, “time” ) 获取当前的时间串。时间格式根据手机本身以及 Locale 来确定。时间值指向到一个字串。 返回 -1 为不支持,0 则为支持。 以下是两个返回的 time 的例子: 6:10:44 PM 18:10:44
GetTimeHours()
status = FSCommand2( “GetTimeHours” ) 获得当前的小时(0-23)。 返回 -1 为不支持,支持则返回 0-23 之间的数字。
GetTimeMinutes()
status = FSCommand2( “GetTimeMinutes” ) 获得当前的分钟(0-59)。 返回 -1 为不支持,支持则返回 0-59 之间的数字。
GetTimeSeconds()
status = FSCommand2( “GetTimeSeconds” ) 获得当前的秒(0-59)。 返回 -1 为不支持,支持则返回 0-59 之间的数字。
GetTimeZoneOffset()
status = FSCommand2( “GetTimeZoneOffset”, “timezoneoffset” ) 获取当前的时差数。时差值指向到一个数字,单位为秒。 返回 -1 为不支持,0 则为支持。 以下是两个返回的 timezoneoffset 的例子: 540: Japan standard time -420: Pacific daylight savings time
平台相关指令::音量
GetMaxVolumeLevel()
status = FSCommand2( “GetMaxVolumeLevel” ) 获取系统最大音量。 返回 -1 为不支持,支持则返回一个数字。
GetVolumeLevel()
status = FSCommand2( “GetVolumeLevel” ) 获取系统当前音量。 返回 -1 为不支持,支持则返回一个数字。
平台相关指令::震动
StartVibrate()
status = FSCommand2( “StartVibrate”, time_on, time_off, repeat ) 设定手机震动,time_on 为开始时间,time_off 为停止时间, repeat 为重复次数。time_on 和 time_off 均为百分秒,并且不超过 5 秒。 返回 -1 为不支持,0 为目前正在震动,1 为出现错误。
StopVibrate()
status = FSCommand2( “StopVibrate” ) 停止震动。 返回 -1 为不支持,0 为停止成功。
平台相关指令::电源
GetBatteryLevel()
status = FSCommand2( “GetBatteryLevel” ) 获得电量。 返回 -1 为不支持,支持则返回一个数字。
GetMaxBatteryLevel()
status = FSCommand2( “GetMaxBatteryLevel” ) 获得最大电量。 返回 -1 为不支持,支持则返回一个数字。
GetPowerSource()
status = FSCommand2( “GetPowerSource” ) 获取供电方式。 返回 -1 为不支持,0 为目前在使用电池供电,1 为目前在使用外部电源供电。
平台相关指令::网络信息
GetMaxSignalLevel()
status = FSCommand2( “GetMaxSignalLevel” ) 获取最大信号强度值。 返回 -1 为不支持,支持则返回一个数字。
GetNetworkConnectStatus()
status = FSCommand2( “GetNetworkConnectStatus” ) 获取当前网络状态。 返回 -1 为不支持,其它则为 0:在网络连接状态; 1:正在试图连接网络; 2:无可用网络连接; 3:网络连接暂停状态; 4:无法判断状态。
GetNetworkName()
status = FSCommand2( “GetNetworkName”, “networkname” ) 获取连接网络的名称,返回值指向一个字串。 返回 -1 为不支持,其它则为 0:未连接网络; 1:连接网络,但是无法获取名称; 2:成功。 返回的 networkname 的例子: AT&T Wireless KPN Mobile
GetNetworkRequestStatus()
status = FSCommand2( “GetNetworkRequestStatus” ) 获取网络请求状态。 返回 -1 为不支持,其它则为 0:等待中,网络连接已经成功,主机名已经解析,服务器也已经连接; 1:等待中,网络连接已经成功; 2:等待中,但是网络连接尚未成功; 3:等待中,连接已经成功,主机名已经解析; 4:失败,网络连接错误; 5:失败,连接服务器失败; 6:服务器返回 404 错误; 7:失败,无法连接 DNS 服务器或者无法解析主机名称; 8:请求成功完成; 9:请求超时; 10:尚未执行请求。
GetNetworkStatus()
status = FSCommand2( “GetNetworkStatus” ) 获取网络状态。 返回 -1 为不支持,其它则为 0:无网络; 1:在本地网络; 2:在本地扩展网络; 3:漫游。
GetSignalLevel()
status = FSCommand2( “GetSignalLevel” ) 获取当前信号强度值。 返回 -1 为不支持,支持则返回一个数字。
平台相关指令::用户设备信息
GetLanguage()
status = FSCommand2( “GetLanguage”, “language”) 获取用户设备使用的语言,返回值指向一个字串。 返回 -1 为不支持,0 则为支持。 返回的 language 值: cs: Czech. da: Danish. de: German. en-UK: UK or international English. en: USA English. es: Spanish. fi: Finnish. fr: French. hu: Hungarian. it: Italian. jp: Japanese. ko: Korean. nl: Dutch. no: Norwegian. pl: Polish. pt: Portuguese. ru: Russian. Platform integration commands 45 sv: Swedish. tr: Turkish. xu: The language cannot be determined. zh-CN: Simplified Chinese. zh-TW: Traditional Chinese.
平台相关指令::用户设备及播放器标识
GetDeviceID()
status = FSCommand2( “GetDeviceID”, “id” ) 获取设备的 ID,返回值指向一个字串。 返回 -1 为不支持,0 则为支持。
GetPlatform()
status = FSCommand2( “GetPlatform”, “platform” ) 获取设备的操作系统平台,返回值指向一个字串。 返回 -1 为不支持,0 则为支持。 返回的 paltform 例子: 506i FOMA1
GetDevice()
status = FSCommand2( “GetDevice”, “device” ) 获取设备的型号,返回值指向一个字串。 返回 -1 为不支持,0 则为支持。
网页教学网--专业的网页教学站点
(责任编辑:webjx)
|