Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    May 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    javascript not triggering in Internet Explorer 9

    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:

    Code:
    <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

  • #2
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,981
    Thanks
    56
    Thanked 557 Times in 554 Posts
    Quote Originally Posted by clouseau View Post
    it works on every browser except IE 9+.
    nope - I get the same error in firefox: "getPlayer("player2").stopMusic is not a function"

  • #3
    New to the CF scene
    Join Date
    May 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #4
    New Coder
    Join Date
    Jan 2012
    Location
    in the uk.
    Posts
    99
    Thanks
    2
    Thanked 6 Times in 4 Posts
    Stopping audio
    Code:
    audioObj.pause()


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •