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

Asynchronous programming<br />

A drag and drop operation starts with a mouseDown and ends when the mouse is released.<br />

In the DragAndDrop.dir movie:<br />

1 The operation starts when you click the And sprite. The on mouseDown() handler in the Drag and Drop behavior<br />

initializes the operation and sets a property which is used to track the state of the operation.<br />

2 As you drag the mouse pointer, the position of the And sprite is updated. Once, per frame, the on enterFrame()<br />

handler moves the And sprite to the same position relative to the mouse.<br />

3 When you release the mouse, the operation ends. As part of its action, the on enterFrame() handler checks if the<br />

mouseDown property is TRUE. If it is not, the mouse is released by the user, and the mDrop() handler is called to<br />

complete the operation.<br />

Here is a simplified version of behavior that handles the Drag and Drop operation. It is attached to the sprite displaying<br />

the word “And”.<br />

Last updated 8/26/2011<br />

423

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

Saved successfully!

Ooh no, something went wrong!