Skip to main content
Inspiring
September 24, 2008
Answered

keyboard commands don't work in loaded swf

  • September 24, 2008
  • 2 replies
  • 409 views
I have a Game swf that uses keyboard Listeners. They work just fine when the swf's played directly. HOWEVER, after the Game's been loaded into a parent Preloader swf - which is playing from an html - , the keyboard Listeners don't function at all.

In the Keyboard Listeners do I have to reference the parent? If so, how? Any help would be greatly appreciated!
This topic has been closed for replies.
Correct answer bhnh
I found the solution.

I'm using a ComboBox Component in the parent Preloader clip, which means that I had to either remove it or create a components FocusManager Object.

For the last line of the EventHandler function for the ComboBox, I added

removeChild(event.target.parent.cBox);

That did the trick.

2 replies

bhnhAuthorCorrect answer
Inspiring
September 24, 2008
I found the solution.

I'm using a ComboBox Component in the parent Preloader clip, which means that I had to either remove it or create a components FocusManager Object.

For the last line of the EventHandler function for the ComboBox, I added

removeChild(event.target.parent.cBox);

That did the trick.
bhnhAuthor
Inspiring
September 24, 2008
Here's an added twist; if I hit the Tab key, the keyboard commands DO work. WTF? Does the Focus have to be set on the child clip??: