07.12.2012 Views

Adobe Director Basics

Adobe Director Basics

Adobe Director Basics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

ADOBE DIRECTOR BASICS<br />

3D: Controlling action<br />

global glKeysPressed<br />

on startMovie()<br />

glKeysPressed = [:]<br />

glKeysPressed.sort()<br />

end startMovie<br />

on keyDown()<br />

vKey = _key.key<br />

vCode = _key.keyCode<br />

if not glKeysPressed.findPos(vKey) then<br />

glKeysPressed.addProp(vKey, vCode)<br />

end if<br />

end keyDown<br />

When a #keyUp event is generated, the script checks which keys recorded in glKeysPressed are still being pressed, and<br />

deletes any that are not.<br />

on CheckKeysPressed()<br />

ii = glKeysPressed.count<br />

repeat while ii<br />

vKey = glKeysPressed.getPropAt(ii)<br />

if not keyPressed(vKey) then<br />

vCode = glKeysPressed.getAt(ii)<br />

if not keyPressed(vCode) then<br />

glKeysPressed.deleteAt(ii)<br />

end if<br />

end if<br />

ii = ii - 1<br />

end repeat<br />

end CheckKeysPressed<br />

Note: This handler checks for both keyPressed(aChar) and keyPressed(aKeyCode) before considering that a key has<br />

been released. See “Issues with keyPressed() on Windows” on page 258 and “Issues with keyPressed() on Macintosh” on<br />

page 257 for more details.<br />

Visualizing different keyboard layouts<br />

To display a keyboard viewer on Mac OS X, you can open the System Preferences at the Input Menu tab of the<br />

International pane. Check the Keyboard Viewer and Show Input Menu In Menu Bar boxes. You now see an Input<br />

menu to the right of the menu bar. You can select Show Keyboard Viewer from this menu. You can also use the same<br />

tab in the System Preferences window to select a variety of different keyboard layouts.<br />

Note that some layouts will produce input which will not display correctly in all fonts. In <strong>Director</strong>, choose a font that<br />

is appropriate for the input language.<br />

On Windows, you can display an On-Screen Keyboard, by selecting Start > All Programs > Accessories > Accessibility<br />

> On-Screen Keyboard. This view allows you to visualize the keyboard layout, but it does not provide you with<br />

feedback on which keys are pressed.<br />

To add an input layout on Windows, you need to choose Control Panel, then Regional and Language Options. Click<br />

the Languages tab and then the Details button. In the Text Services and Input Languages window, click Add, and then<br />

make your selections.<br />

An input selection menu will appear near the right end of the task bar. You can select which input layout and language<br />

you wish to use there.<br />

Last updated 8/26/2011<br />

256

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

Saved successfully!

Ooh no, something went wrong!