MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 299

Actionscript language reference
Table of Contents

Advertisement

}
function myOnKeyDown() {
// 55 is key code for 7
if (Key.isDown(Key.CONTROL) && Key.getCode() == 55) {
Selection.setFocus(my_btn);
my_btn.onPress();
}
}
var myListener:Object = new Object();
myListener.onKeyDown = myOnKeyDown;
Key.addListener(myListener);
my_btn.onPress = myOnPress;
my_btn._accProps.shortcut = "Ctrl+7";
Accessibility.updateProperties();
Key.DELETEKEY
Availability
Flash Player 5.
Usage
Key.DELETEKEY:Number
Description
Property; constant associated with the key code value for the Delete key (46).
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.DELETEKEY
299

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flex

Table of Contents