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

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

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

Note: The onDragOut Event H<strong>and</strong>ler is supported for Flash Lite 2.0 only if<br />

System.capabilities.hasMouse is true or System.capabilities.hasStylus is<br />

true.<br />

Example<br />

The following example demonstrates how you can execute statements when the pointer is<br />

dragged off a button. Create a button called my_btn on the Stage <strong>and</strong> enter the following<br />

ActionScript in a frame on the Timeline:<br />

my_btn.onDragOut = function() {<br />

trace("onDragOut: "+this._name);<br />

};<br />

my_btn.onDragOver = function() {<br />

trace("onDragOver: "+this._name);<br />

};<br />

onDragOver (Button.onDragOver h<strong>and</strong>ler)<br />

onDragOver = function() {}<br />

Invoked when the user presses the mouse button outside of the button <strong>and</strong> then drags the<br />

pointer over the button. You must define a function that is executed when the event h<strong>and</strong>ler is<br />

invoked.<br />

Note: The onDragOver Event H<strong>and</strong>ler is supported for Flash Lite 2.0 only if<br />

System.capabilities.hasMouse is true or System.capabilities.hasStylus is<br />

true.<br />

Example<br />

The following example defines a function for the onDragOver h<strong>and</strong>ler that sends a trace()<br />

statement to the Output panel. Create a button called my_btn on the Stage <strong>and</strong> enter the<br />

following ActionScript on the Timeline:<br />

my_btn.onDragOut = function() {<br />

trace("onDragOut: "+this._name);<br />

};<br />

my_btn.onDragOver = function() {<br />

trace("onDragOver: "+this._name);<br />

};<br />

When you test the SWF file, drag the pointer off the button instance. Then, while pressing<br />

the mouse button, drag onto the button instance again. Notice that the Output panel tracks<br />

your movements.<br />

Button 261

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

Saved successfully!

Ooh no, something went wrong!