In working on a few games recently, me and my co-workers have come accross some peculiar behavior using the FScommand and Javascript (note: we did not experience this problem in IE 5).

I will give you an example of one of our projects to explain and clarify the issue we have dealt with. Then, I will mention our somewhat cumbersome solution:

In the flash movie there are four columns. The user clicks on any of the columns, which calls an FScommand and passes the 'args'. The 'args' passed is the name of a textfield within the Flash movie (the name passed varies based on the column clicked on). The FScommand within the HTML page calls a Javascript function that captures all keyboard entry and passes the keypresses into the Flash movie textfield identifited by the 'args'.

The peculiar behavior we ran into was that we couldn't get Netscape to do anymore than one simple line of code (such as an alert) in the FScommand. Our keycapture was not being activated and nothing was being passed back into Flash. We decided to pass the 'command' and 'args' from the Fscommand on to another JS function called by the FScommand, allowing it to do the 'if/else' work. That didn't work either.

Our solution was to not only pass the 'command' and 'args' to another function, but in calling that function, use a setTimeout. As it turns out, there is a timing issue with the way the Flash plugin and netscape do their communciation which causes hic-ups in the code.

Our code in the FScommand can be sumarised as such:

function movie_DoFSCommand(command, args) {
if (top.browser=="NAV") {
setTimeout("MyFunction(\""+command+"\",\""+args+"\ ")",1000)
}
else
MyFunction(command,args);
}

The timeout can be set to '0' and is still works. If anyone has a better solution to the timing problem, please let me know.

Thanks, Patrick