Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
Subject: | Re: FLASH: Capturing keyboard events to trigger Flash actions (per request) |
From: | Nigel Randsley-Pena |
Date: | Mon, 31 Aug 1998 14:04:38 +0100 |
Ali Kim wrote:
> Hi,
> I tried to test your example with "moving red ball" and got an javascript error
> in MSIE 4.0 "No definition for _level0" and
> in Netscape 4.05 "Movie has no properties"
> Can you help me with this problem?
Sure can. First of all sorry for the errors included but instead of
cutting and pasting I typed in the script from memory. So here is the
correct script pasted, this one works, I double checked.
<-- Cut Below---
<SCRIPT LANGUAGE="JavaScript">
<!-- OK let's comment this out
document.onkeypress = keyHandler;
var IE=(typeof window.event=='object');
function keyHandler (e)
{
if (IE)
{
theKey = String.fromCharCode(event.keyCode);
}
else
{
theKey = String.fromCharCode(e.which);
}
react (theKey);
return false;
}
function react (key)
{
var theMovie = IE ? movie : document.movie;
if ( key =='a' || key =='A' )
{
if ( theMovie.TCurrentFrame('_level0')== 24)
theMovie.TGotoFrame('_level0', 0);
else
theMovie.TGotoFrame('_level0',
theMovie.TCurrentFrame('_level0') + 1);
}
if ( key =='s' || key =='S' )
{
if ( theMovie.TCurrentFrame('_level0')==0)
theMovie.TGotoFrame('_level0', 24)
else
theMovie.TGotoFrame('_level0',
theMovie.TCurrentFrame('_level0') -1);
}
return false;
}
//-->
</SCRIPT>
<-- Cut above ---
------------------------------------------------------------------------
To UNSUBSCRIBE send: unsubscribe flasher in the body of an
email to list-manager


N.B. Email address must be the same as the one you used to subscribe.
For info on digest mode send: info flasher to list-manager

Replies
FLASH: Capturing keyboard events to trig, Nigel Randsley-Pena
Re: FLASH: Capturing keyboard events to , ali_kim
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]