Skip to main content
Known Participant
February 15, 2016
Answered

Is there a way a Captivate 8 swf file can take focus when the html page loads?

  • February 15, 2016
  • 2 replies
  • 303 views

I'm trying to create a project in Captivate 8 that the user can move through using either the playbar or the keyboard. I've added buttons to the slides with Page Up and Page Down shortcut keys, but the keyboard controls don't work until the user has given focus to the swf file by clicking in it, Is there a way for the swf file to take focus automatically when it loads? I tried changing the wmode setting to "opaque," but that didn't make a difference.

Or, are there keys or key combinations that will work even if the swf file doesn't have focus?

-Stuart

This topic has been closed for replies.
Correct answer TLCMediaDesign

Captivate already has a script to throw focus. You can try adding it the body onload. Add the script to the head section

<script>

function setFocus()

{

document.getElementById('Captivate').focus();

document.Captivate.focus();

}

</script>

then add the function to the body:

<body bgcolor="#f2f2f2" onLoad="setFocus()">

2 replies

EilmerAuthor
Known Participant
February 16, 2016

Thanks! This code solved the problem, except in Firefox, which, from some other posts I've read, seems to handle this issue differently. That's not a problem, though, since my client on this project prefers IE.

Thanks again!

TLCMediaDesign
TLCMediaDesignCorrect answer
Inspiring
February 15, 2016

Captivate already has a script to throw focus. You can try adding it the body onload. Add the script to the head section

<script>

function setFocus()

{

document.getElementById('Captivate').focus();

document.Captivate.focus();

}

</script>

then add the function to the body:

<body bgcolor="#f2f2f2" onLoad="setFocus()">