Deletekey (Key.deletekey Property) - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

DELETEKEY (Key.DELETEKEY property)

public static DELETEKEY : Number
The key code value for the Delete key (46).
Availability: ActionScript 1.0; Flash Player 5
Example
The following example lets you draw lines with the mouse pointer using the Drawing API and
listener objects. Press the Backspace or Delete key to remove the lines that you draw.
this.createEmptyMovieClip("canvas_mc", this.getNextHighestDepth());
var mouseListener:Object = new Object();
mouseListener.onMouseDown = function() {
this.drawing = true;
canvas_mc.moveTo(_xmouse, _ymouse);
canvas_mc.lineStyle(3, 0x99CC00, 100);
};
mouseListener.onMouseUp = function() {
this.drawing = false;
};
mouseListener.onMouseMove = function() {
if (this.drawing) {
canvas_mc.lineTo(_xmouse, _ymouse);
}
updateAfterEvent();
};
Mouse.addListener(mouseListener);
//
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.isDown(Key.DELETEKEY) || Key.isDown(Key.BACKSPACE)) {
canvas_mc.clear();
}
};
Key.addListener(keyListener);
When you use this example, be sure to select Control > Disable Keyboard Shortcuts in the test
environment.
The
MovieClip.getNextHighestDepth()
7 or later. If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
method used in this example requires Flash Player
MovieClip.getNextHighestDepth()
method.
Key
675

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF