Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Remove "Press Spacebar..."


mvglafrica

Recommended Posts

Hi All

 

I added some Flash into my Index.php and with IE (like with other Sites that have Flash Content) whenever the index is loaded, the famous "Press Spacebar or Enter to activate this Control" appears.

 

Does anyone know of a snippet of code that I can add to my index.php file to remove this?

 

Any help would be appreciated.

 

Guido

Link to comment
Share on other sites

The easy way:

 

Create a new page that turns your Flash object code into a javascript function.

 

function writeFlash(){

document.write(' FLASH HTML CODE HERE ');

}

 

Save the page like so: flash.js

 

Then include the javascript page in the header of your page

<script language="javascript" type="text/javascript" src="flash.js"></script>

 

Next, within your html where ever you wish to have the Flash object displayed you write

<script language="javascript" type="text/javascript">

writeFlash();

</script>

 

The neat thing about doing it this way as opposed to some other ways is it provides an easy way to include flashvars.

Link to comment
Share on other sites

The easy way:

 

Create a new page that turns your Flash object code into a javascript function.

 

function writeFlash(){

document.write(' FLASH HTML CODE HERE ');

}

 

Save the page like so: flash.js

 

Then include the javascript page in the header of your page

<script language="javascript" type="text/javascript" src="flash.js"></script>

 

Next, within your html where ever you wish to have the Flash object displayed you write

<script language="javascript" type="text/javascript">

writeFlash();

</script>

 

The neat thing about doing it this way as opposed to some other ways is it provides an easy way to include flashvars.

 

What if the user has flash but not javascript, you kill both its a double whammy. I would find you more likely to have javascript off too.

Link to comment
Share on other sites

Then you could get more complicated and run a script that looks to the browser type. If its a Microsoft one, use javascript, otherwise it can be scripted as a normal object/embed since Microsoft is the one who needs the fix.

 

The <noscript> tag is useful, too.

 

That being said, Flash should always be looked at as an enhancement, not a requirement to a website. People will disagree with that assement, but when you have visitors who come to your site time and time again, they don't want to mess with anything that is going to slow down their experience.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...