_cap4WayKeyAS

可用性

Flash Lite 1.1。

用法

_cap4WayKeyAS

说明

数值变量;表明 Flash Lite 是否执行附加到与右箭头键、左箭头键、上箭头键和下箭头键相关联的按键事件处理函数的 ActionScript 表达式。只有当主机应用程序使用四向键导航模式在 Flash 控件(按钮和输入文本字段)之间移动时,才会定义此变量并具有值 1。否则,不定义此变量。

在按下其中一个四向键时,如果此变量的值为 1,则 Flash Lite 首先查找该键的处理函数。如果未找到,则会进行 Flash 控件导航。但是,如果找到事件处理函数,则不会执行该键的导航动作。例如,如果找到了下箭头键的按键处理函数,则用户不能进行导航。

示例

以下示例在 Flash Lite 1.1 中将 canUse4Way 设置为 1,而在 Flash Lite 1.0 中不进行定义(但由于并不是所有 Flash Lite 1.1 电话都支持四向键,因此,这段代码的使用还取决于电话):

canUse4Way = _cap4WayKeyAS;
 if (canUse4Way == 1) {
     msg = "Use your directional joypad to navigate this application";
 } else {
     msg = "Please use the 2 key to scroll up, the 6 key to scroll right, the 8 key to scroll down, and the 4 key to scroll left.";
 }