03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

If the _focusrect property is set to false, then keyboard navigation for that button is<br />

limited to the Tab key. All other keys, including the Enter <strong>and</strong> arrow keys, are ignored. To<br />

restore full keyboard navigation, you must set _focusrect to true.<br />

Note: For the Flash Lite 2.0 player, when the _focusrect property is disabled (in other<br />

words, Button.focusRect is false), the button receives all events. This behavior is<br />

different from Flash Player behavior because when the _focusrect property is disabled, the<br />

button receives the rollOver <strong>and</strong> rollOut events but does not receive the press <strong>and</strong><br />

release events.<br />

Also for Flash Lite 2.0, you can change the color of the focus rectangle using the fscomm<strong>and</strong>2<br />

SetFocusRectColor comm<strong>and</strong>. This behavior is also different from Flash Player, for which<br />

the color of the focus rectangle is restricted to yellow.<br />

Example<br />

This example demonstrates how to hide the yellow rectangle around a specified button<br />

instance in a SWF file when it has focus in a browser window. Create three buttons called<br />

myBtn1_btn, myBtn2_btn, <strong>and</strong> myBtn3_btn, <strong>and</strong> add the following ActionScript to Frame 1<br />

of the Timeline:<br />

myBtn2_btn._focusrect = false;<br />

Make sure that you disable keyboard shortcuts when you test the SWF file by selecting<br />

Control > Disable Keyboard Shortcuts in the test environment.<br />

When _focusrect is disabled, you cannot execute code for this button by pressing Enter or<br />

the Spacebar.<br />

getDepth (Button.getDepth method)<br />

public getDepth() : Number<br />

Returns the depth of the button instance.<br />

Each movie clip, button, <strong>and</strong> text field has a unique depth associated with it that determines<br />

how the object appears in front of or in back of other objects. Objects with higher depths<br />

appear in front.<br />

Returns<br />

Number - The depth of the button instance.<br />

Example<br />

If you create myBtn1_btn <strong>and</strong> myBtn2_btn on the Stage, you can trace their depth using the<br />

following ActionScript:<br />

258 ActionScript classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!