...

View Full Version : javascript not triggering in Internet Explorer 9



clouseau
02-16-2012, 04:01 PM
I've got a flash music player (audioplay) on a site (yeah, I know, I hate music on websites too, but the client wants it).

I'm using javascript to trigger "stop" and "play" and it works on every browser except IE 9+.
The error in IE's developer says: SCRIPT438: Object doesn't support property or method 'stopMusic'

Here's the javascript:


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

function getPlayer(movieName)
{
if (navigator.appName.indexOf("Microsoft") != -1)
{
return window[movieName];
}
else
{
return document[movieName];
}
}

function play2()
{
getPlayer('player2').playMusic();
}

function stop2()
{
getPlayer('player2').stopMusic();
}

</script>

Here's the working example: EXAMPLE (http://www.paulgregoryphotography.com)

xelawho
02-16-2012, 04:15 PM
it works on every browser except IE 9+.

nope - I get the same error in firefox: "getPlayer("player2").stopMusic is not a function"

clouseau
02-16-2012, 05:10 PM
Ahh, crap. I've only been testing it on FF 10. I just checked it on FF 8 & 9 and nothing. This audioplay is outdated. It seems to me the javascript code could be modified to make it work but I don't know enough about it.

Cremator
02-17-2012, 11:21 AM
Stopping audio

audioObj.pause()



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum