07.12.2012 Views

Adobe Director Basics

Adobe Director Basics

Adobe Director Basics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ADOBE DIRECTOR BASICS<br />

3D: Controlling action<br />

Treating keyboard input<br />

You can use an on keyDown() handler to detect when the user is pressing a character key, and an on enterFrame()<br />

handler to detect when the user is pressing an arrow key or a modifier key.<br />

To see an example of this, using text display rather than real 3D actions, download and launch the movie<br />

CustomControlDemo.dir.<br />

When it has keyboard focus, the behavior on the 3D sprite detects key presses and converts them into actions<br />

The CustomControlDemo.dir movie contains an editable sprite. Before the 3D sprite can receive any keyboard events,<br />

the user must ensure that it has keyboard focus. See the Customizable Controls behavior on the 3D sprite for a<br />

suggestion on how to convert keyboard input into actions using a list of action keys.<br />

Note: The movie does not show you how to customize this list of action keys. It simply shows how to work with a<br />

customized list that has been created elsewhere.<br />

Motion<br />

Movement in a 3D world can be controlled in several different ways.<br />

You can move 3D nodes around using Lingo or JavaScript code. See “Code-driven motion” on page 260.<br />

You can add a keyFrame motion to a model to move it through space. See “Keyframe animations” on page 274.<br />

You can add a bones motion to a model to change the shape of its internal mesh. See “Bones animations” on<br />

page 276.<br />

You can create animated particle emitters. See “Particles” on page 197.<br />

You can apply physical features, such as, mass and force, to models, and rely on a Physics member created by the<br />

Dynamiks xtra to control all the interactions in a deterministic way. See “Physics” on page 293 for details.<br />

Code-driven motion<br />

You can use Lingo or JavaScript code to place a node in 3D space, and to set its orientation and scale. See “Arranging<br />

objects in a 3D world” on page 202 for a description of the Lingo and JavaScript terms that you need to achieve this.<br />

Last updated 8/26/2011<br />

260

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

Saved successfully!

Ooh no, something went wrong!