Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

thanks :)

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
i can't use a button, because the flash login has to replace a Java applet on a visited web page, and it would seem strange to the users if they had to click on a button before loggin in, but I put a JavaScript handle onLoad. It only works in windows Explorer, i think, but that's the best I can do :)

Thanx for the tip.
 
Here's a script by David Doull... Don't remember if I've tested it with NS, but you could try it if it's different from your's.

You can use javascript to set the focus to the flash file once the web page is loaded.

In the html code for the page for your flash file you will need to ensure that the name and id tag elements are contained within the html for your flash file. In other words you need to ensure that your flash file has a name and an id.

These tag elements aren't always included by default. In Dreamweaver you can set these using the properties inspector.

Alternatively in HTML you need to :

Within the <OBJECT> tag include id=&quot;mygame&quot; name=&quot;mygame&quot;
Within the <EMBED> tag include name=&quot;mygame&quot;.
Replace mygame with whatever name you want to give your game.

Your HTML code for your flash file will look something like:

<OBJECT classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; codebase=&quot;shockwave/cabs/flash/swflash.cab#version=5,0,0,0&quot;id=&quot;mygame&quot; name=&quot;mygame&quot;><PARAM NAME=movie VALUE=&quot;spaceflight.swf&quot;>
<EMBED src=&quot;spaceflight.swf&quot;
TYPE=&quot;application/x-shockwave-flash&quot;
PLUGINSPAGE=&quot;download/index.cgi?P1_Prod_Version=ShockwaveFlash&quot; name=&quot;mygame&quot;>
</EMBED></OBJECT>

Now, all you need to do is include the line onLoad=&quot;mygame.focus()&quot; within the BODY tag. So your body tag will look something like:

<body bgcolor=&quot;#FFFFFF&quot; onLoad=&quot;mygame.focus()&quot;>

Replace mygame with whatever name you want to give your game, just make sure its the same name you used for your id and name elements.



Regards,

new.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top