;

PDA

Click to See Complete Forum and Search --> : ExternalInterface.call and set focus after HTML click


Kennyb
07-05-2006, 07:27 AM
I have a audio player that takes its audio file name from a link in the HTML. I'm using ExternalInterface.call in Flash with a JavaScript link in the HTML.

My player has a function that normally runs when the space bar is pressed. However, when I select an HTML link, I lose focus on the Flash player, so - when the space bar is pressed nothing happens. If I click the player to give it focus, then the space bar works on the player.

How can I return focus to the player after the HTML click? Here is what the html link looks like.

<p>1. <a class=Uline href="javascript: void();" onclick="makeCall('normalSong')" title="Normal Song" border=0>Audio 1.</a></p>

Thanks.

cancerinform
07-05-2006, 08:54 AM
I am not sure you can do something, since what you describe is similar to opening another browser window. If you don't click on the original window, you don't have focus.

This seems to occur only with javascript, since regular links are not affected.

Kennyb
07-05-2006, 09:07 AM
Thanks for the response. I was afraid of that. Someone has suggested to me (without explanation) that the following may help, but I have no experience with it.

var WshShell = new ActiveXObject('WScript.Shell');
WshShell.AppActivate("APPLICATION_NAME");

I have no idea how to implement that in any helpful way, but someone told me it might help.