- 最后登录
- 2024-6-3
- 注册时间
- 2009-10-16
- 阅读权限
- 100
- 积分
- 18803
- 纳金币
- 17488
- 精华
- 1
|
Focusable (Interactive Behavior)
Summary
Causes the parent object to be 'focusable', sending events as it gains and loses focus.
Category
Latest Behaviors
Author
Gavin Kistner
Difficulty
(Reference)
Time to Complete
5 Minutes
Downloads
Click Here
to download the associated files.
(This document covers version 1.1.5 of the 'Focusable' behavior, current as of 2005-Apr-08)
Description
The parent of this object will have
.focus()
and
.blur()
methods exposed in script, and will itself fire an
onFocus
event when clicked on (or explicitly focused through script or action), and will fire an
onBlur
event when another object gets focus.
For convenience in the Studio environment, this behavior also provides a
Focus Parent
action and a
Blur Parent
action, as well as catching the
onFocus
and
onBlur
events from the parent and passing them along.
When using script to subscribe to the
onFocus
or
onBlur
events of the action, the .object property of the event object will point to the parent object of this behavior.
The core of this behavior is used in the Arrow Nudge and Editable Text behaviors, to give focus to only one element at a time for user input.
Basic Properties
Use Selected Color?
Change the object to another color when focused?
Selected Color
Color to use for the object when focused.
Actions
Focus Parent
Move focus to the parent element.
Blur Parent
Remove focus from the parent element.
Events
onFocus
Fires when the parent element receives focus.
onBlur
Fires when the parent element loses focus.
Demonstration
View Demonstration Project
Download Project File
|
|