Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 758999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:32:43+00:00 2026-05-14T15:32:43+00:00

I’m using the following script on my website to play an mp3 in flash.

  • 0

I’m using the following script on my website to play an mp3 in flash.
To instantiate the flash object I use the swfobject framework in a javascript function. When the function is called the player is created and added to the page.

The rest of the website is in php and the page calling this script is being included with the php include function. All the other used scripts are in the php ‘master’-page

var playerMp3 = new SWFObject("scripts/player.swf","myplayer1","0","0","0");
    playerMp3.addVariable("file","track.mp3");
    playerMp3.addVariable("icons","false");
    playerMp3.write("player1");

    var player1 = document.getElementById("myplayer1");
    var status1 = $("#status1");

    $("#play1").click(function(){
        player1.sendEvent("play","true");
        $("#status1").fadeIn(400);
        player4.sendEvent("stop","false");
        $("#status4").fadeOut(400);
        player3.sendEvent("stop","false");
        $("#status3").fadeOut(400);
        player2.sendEvent("stop","false");
        $("#status2").fadeOut(400);
    });
    $("#stop1").click(function(){
        player1.sendEvent("stop","false");
        $("#status1").fadeOut(400);
    });
    $(".closeOver").click(function(){
        player1.sendEvent("stop","false");
        $("#status1").fadeOut(400);
    });
    $(".accordionButton2").click(function(){
        player1.sendEvent("stop","false");
        $("#status1").fadeOut(400);
    });
    $(".accordionButton3").click(function(){
        player1.sendEvent("stop","false");
        $("#status1").fadeOut(400);
    });
    $(".turnOffMusic").click(function(){
        player1.sendEvent("stop","false");
        $("#status1").fadeOut(400);
    });
});

I have a play-button with the id ‘#play1’ and a stop-button with the id ‘#stop1’ on my page. A div on the same page has the id ‘#status1’ and a little image of a speaker is in the div.
When you push the playbutton, the div with the speaker is fading in and when you push the stopbutton, the div with the speaker is fading out, very simple. And it works as I want it to do.

But the problem is, when a song is finished, the speaker doesn’t fade out. Is there a simple solution for this? I already tried using the swfobject framework to get the flash player from the page and call the ‘IsPlaying’ on it, but I’m getting the error that ‘swfobject’ can’t be found. All I need is a little push in the right direction or an example showing me how I can correctly get the currently playing audio player (in flash), check if it’s playing and if finished, call a javascript function to led the speaker-image fade-out again. Hope someone here can help me

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T15:32:43+00:00Added an answer on May 14, 2026 at 3:32 pm

    Because lack of time we’ve decided to run a JS timer in the background with a length equal to the length of the mp3 playing in flash. In time i’ll rewrite the code to the swfobject 2.x syntax. Any suggestions to this problem are still welcome!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the following JavaScript code: <script language=JavaScript1.2 type=text/javascript> function CreateBookmarkLink(title, url) { if
I'm using the following script in my website in order to create pagination next-previous
Ok, I have been using the following script for over a year now to
I'm using the following html to load dojo from Google's hosting. <script src=http://www.google.com/jsapi></script> <script
Backed up a database from my hosting account. Using the following script to restore.
i have the following script i am using to scrap data from my uni
Using the following Webservice definition using aClientArgs as a complex type: [System.Web.Script.Services.ScriptService] public class
I am using the following JS function to open a pop-up window to display
I am using JavaScript in a bookmarklet to populate form elements on a website:
I am using following PHP code to connect to MS Access database: $odb_conn =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.