Author Message

Posted: Mon Nov 16, 2009 6:01 pm   Post subject: Temporarily Suspend Keyboard Listener

How can I temporarily turn off the KeyboardEvent listener in the SWF?

I am experiencing problems when the SWF playback window does not have the focus... If the user is typing in a text field, the Slideshow is advancing when the proper keys are pressed (like spacebar)


Profile profile test

Posted: Tue Nov 17, 2009 3:14 pm   Post subject: Re: Temporarily Suspend Keyboard Listener

There are several ways to do so:

1. When converting the presentation you need to disable keyboard navigation. In this case keyboard will not be handled by the presentation.
However you may still handle keyboard on your own way and control the presentation playback using ActionScript API.

2. Keyboard is handled by a skin module. You may develop your own skin module which will enable keyboard handling when the presentation obtains focus and disable keyboard handling when the presentation loses focus.

3. You may rely on the current implementation of the skin module which takes care on a value of the navigation.keyboard.enabled property of the Settings object. Changing this property value in run time you may enable or disable keyboard handling

Code:
var p:IPlayer = ...;

function onMyTextFieldFocusIn()
{
   // enable keyboard in run time
   p.getSettings().navigation.keyboard.enabled = true;
}

function onMyTextFieldFocusOut()
{
   // disable keyboard in run time
   p.getSettings().navigation.keyboard.enabled = false;
}


The following sample will illustrate you an idea:
C:\Program Files\iSpring\Presenter\samples\as2\presentation-control\keyboard_navigation.fla


Profile profile test WWW www ICQ ICQ
Display posts from previous:  Sort by  

  


Who is online
Who is online In total there are 9 users online :: 2 registered, 0 hidden and 7 guests (based on users active over the past 5 minutes)
Most users ever online was 108 on Thu Nov 21, 2013 3:41 pm

Registered users: Bing [Bot], Google [Bot]