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 3 of 3
  1. #1
    New Coder
    Join Date
    May 2008
    Posts
    12
    Thanks
    2
    Thanked 0 Times in 0 Posts

    stop swf with JavaScript

    I have a flash movie playing, I want to stop the movie playing using javascript. On a click of a form button for example.

    I have tried naming my movie within the object tag:

    name="myMovie"

    and then calling a function from the onClick of a button:

    <input type="button" value="Stop" name="Stop" onClick="StopFlashMovie();">

    Function:

    <script language="JavaScript">

    function StopFlashMovie()
    {
    document. myMovie.StopPlay();
    }

    </script>


    However this does not seem to work. I dont think I'm far off....?

    Thanks

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    I seem to recall that, while

    document["flashObjectName"]

    would work for non-IE browsers, for IE you needed

    window["flashObjectName"]

  • #3
    New Coder
    Join Date
    May 2008
    Posts
    12
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Spudhead View Post
    I seem to recall that, while

    document["flashObjectName"]

    would work for non-IE browsers, for IE you needed

    window["flashObjectName"]
    So how would I go about solving the issue in all main browsers?


  •  

    Posting Permissions

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