Slide.defaultKeydownHandler

Availability

Flash Player 6 (6.0.79.0).

Edition

Flash MX Professional 2004.

Usage

mySlide.defaultKeyDownHandler = function (eventObj) {
    // Your code here.
}

Parameters

eventObj An event object with the following properties:

Returns

Nothing.

Description

Callback function; lets you override the default keyboard navigation with a custom keyboard handler that you create. For example, instead of having the Left and Right Arrow keys navigate to the previous and next slides in a presentation, respectively, you could have the Up and Down Arrow keys perform those functions. For a discussion of the default keyboard handling behavior, see Slide.autoKeyNav.

Example

In that example, the default keyboard handling is altered for child slides of the slide to which the on(load) handler is attached. This handler uses the Up and Down Arrow keys for navigation instead of the Left and Right Arrow keys.

on (load) {
    this.defaultKeyDownHandler = function(eventObj:Object) {
        switch (eventObj.code) {
        case Key.DOWN :
            this.currentSlide.gotoNextSlide();
            break;
        case Key.UP :
            this.currentSlide.gotoPreviousSlide();
            break;
        default :
            break;
        }
    };
}

See also

Slide.autoKeyNav