Pay for Hesitation: Notes for the Focus Events

Pages

2010年3月4日 星期四

Notes for the Focus Events

1. focus event 即keyboard focus event.

2. in AS3, 同一時間只有一個object能收到focus event.

3. 語法: object.stage.focus = focusObject;

4. automatic tab order: from left to right, from bottom up
custom tab order: 透過設置 .tabIndex tab event觸發時, 會依tabIndex由小至大focus

5. .visible set to false 會自動排除被tab event觸發

6. .tabChildren set to false, 則container下的child 都會沒有tabIndex.

7. flash player預設, 被tab focus的物件外圍都會有黃色框, 可以將.focusRect set to false 來取消.
stage則需將.stageFocusRect set to false.

8. 利用下面三種方法, 可以讓物件在觸發mouse event後, 得到focus
(1) .buttonMode set to true.
(2) .tabEnabled set to true.
(3) .tabIndex set to a nonnegative integer

p.s. 若該物件是container, 則其下所有的子物件都會得到focus.


9. 反之, 將 .mouseEnabled set to false
.mouseChildren set to false 使容器下的物件都不會因為mouse event而得到focus

10. 同上, 將 .tabEnabled set to false
.tabChildren set to false
除TextField object例外, 是flash player 的bug

沒有留言: