# Keystrokes don't work in html

**URL:** <https://forum.kirupa.com/t/keystrokes-dont-work-in-html/61949>\
**Category:** Uncategorized\
**Created:** [August 23, 2004, 4:38pm UTC](https://forum.kirupa.com/t/keystrokes-dont-work-in-html/61949 "2004-08-23T16:38:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![provdes](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@provdes](https://forum.kirupa.com/u/provdes)\
**Post date:** [August 23, 2004, 4:38pm UTC](https://forum.kirupa.com/t/keystrokes-dont-work-in-html/61949/1 "2004-08-23T16:38:42Z")

</div>

Been working pretty hard on converting a flash presentation so I can use it my website portfolio.

The presentation used keystrokes to navigate instead of button so the presenter didn’t need to wave a mouse pointer all over the screen.

I have published my flash file to the web, embedded it in an html page and now the keystrokes don’t work.

Can anyone shed any light?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 23, 2004, 4:52pm UTC](https://forum.kirupa.com/t/keystrokes-dont-work-in-html/61949/2 "2004-08-23T16:52:23Z")

</div>

They don’t work at all?  
Or they work after you set focus on the flash movie?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 23, 2004, 4:59pm UTC](https://forum.kirupa.com/t/keystrokes-dont-work-in-html/61949/3 "2004-08-23T16:59:35Z")

</div>

> [@claudio](#):
>
> They don’t work at all?  
> Or they work after you set focus on the flash movie?

set focus?

When I export my file to swf and test it they keystokes work fine. When I open up the swf file from windows on its own - they work fine.

When I import the swf file into an html page and open it up - they dont work at all. :h:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 23, 2004, 5:04pm UTC](https://forum.kirupa.com/t/keystrokes-dont-work-in-html/61949/4 "2004-08-23T17:04:26Z")

</div>

Yes, set focus.  
Try opening the html page, click on the flash movie and then test the keystrokes.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 23, 2004, 5:16pm UTC](https://forum.kirupa.com/t/keystrokes-dont-work-in-html/61949/5 "2004-08-23T17:16:23Z")

</div>

> [@claudio](#):
>
> Yes, set focus.  
> Try opening the html page, click on the flash movie and then test the keystrokes.

AH! Set Focus! Yes it now works! (who feels a bit dozey now :-/ )

Thank you.

Is there any coding way of bypassing this? (the movie is launced in a new window and without me putting a ‘play movie’ button in, the viewer would have no need to click on the page)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 23, 2004, 6:03pm UTC](https://forum.kirupa.com/t/keystrokes-dont-work-in-html/61949/6 "2004-08-23T18:03:56Z")

</div>

Yes, open the html document and find the _id_ parameter inside the \<object\> tag.  
Something like this:

```auto
<OBJECT.... id="mymovie" ....>

```

Now, edit the tag:

```auto
<body onLoad=mymovie.focus()>

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 23, 2004, 7:23pm UTC](https://forum.kirupa.com/t/keystrokes-dont-work-in-html/61949/7 "2004-08-23T19:23:12Z")

</div>

Thats great.

I used this for the body copy though to get it to work:

\<body bgcolor="#333333" onLoad=“window.document.[color=slategray]myMovie[/color].focus();”\>\<body \>
