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 />

-- Lingo syntax<br />

on mouseDown<br />

-- user interaction/animation is about to start so turn<br />

-- anti-aliasing OFF<br />

sprite(1).antiAliasingEnabled = FALSE<br />

-- start animation<br />

end<br />

on mouseUp<br />

-- stop animation<br />

-- the interaction/animation has ended so turn<br />

-- anti-aliasing ON<br />

sprite(1).antiAliasingEnabled = TRUE<br />

end<br />

// JavaScript syntax<br />

function mouseDown() {<br />

// user interaction/animation is about to start so turn<br />

// anti-aliasing OFF<br />

sprite(1).antiAliasingEnabled = false;<br />

}<br />

//start animation<br />

function mouseUp() {<br />

// stop animation<br />

}<br />

// the interaction/animation has ended so turn<br />

// anti-aliasing ON<br />

sprite(1).antiAliasingEnabled = true;<br />

suspendUpdates<br />

Displaying changes on the screen is very time consuming, and it can be distracting. When initializing your world, you<br />

may want to prevent any changes from being made visible. To do this, set the 3D sprite property<br />

sprite3D.suspendUpdates to TRUE. After you have finished your initialization, set it back to FALSE.<br />

During a lengthy initialization process, you will want to provide feedback to the end-user about what is happening.<br />

One way to do this is to use perform different initialization steps in an on enterFrame() handler, and to update a<br />

progress bar at each step.<br />

To see an example of a (faked) initialization sequence that uses suspendUpdates to freeze the 3D sprite, download<br />

and launch the movie Suspend.dir.<br />

Last updated 8/26/2011<br />

394

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

Saved successfully!

Ooh no, something went wrong!