www.webdeveloper.com
Results 1 to 13 of 13

Thread: detecting a loop(repeat) with the bgsound

  1. #1
    Join Date
    Mar 2005
    Location
    Behind you...
    Posts
    966

    detecting a loop(repeat) with the bgsound

    I would like to know if there is any way to detect(using an event) a loop with the bgsound.

    Is there any type of event that triggers when the bgsound finished playing the source file, or is there an event that triggers when the bgsound loops the sound?

    I have been trying to find a way to preform an action when the source file for the bgsound is done playing, but so far I have found nothing.


    I'm not sure that it is possible, but I am asking just to make sure.

    Thanks in advance.
    "Given billions of tries, could a spilled bottle of ink ever fall into the words of Shakespeare?"

  2. #2
    Join Date
    Feb 2005
    Posts
    1,018
    No not with html or javascript. It can be done in flash. What type of action are you trying to perform?
    If you can't handle the job then don't take the job or ask for help on it if you are getting paid for it.
    Web Developer's Handbook.::.Why Tables for Layout is Stupid?.::.Why I won't help you

  3. #3
    Join Date
    Mar 2005
    Location
    Behind you...
    Posts
    966
    i am making a media player. i am wanting to change songs(src) when a song ends.
    "Given billions of tries, could a spilled bottle of ink ever fall into the words of Shakespeare?"

  4. #4
    Join Date
    Oct 2006
    Posts
    939
    I have an array of all my sound files. I had to write a second array with all their running times in seconds, then write a counter script and give it an extra 10 seconds or so, my Windows Media player seems to freeze up at the end of playing a file, don't know if yours does that too.

  5. #5
    Join Date
    Mar 2005
    Posts
    78
    If your running win media then you need to script from asx link the asx in the url for your media player.

    http://msdn2.microsoft.com/en-us/library/ms910265.aspx

  6. #6
    Join Date
    Mar 2005
    Location
    Behind you...
    Posts
    966
    Quote Originally Posted by justinbarneskin
    I have an array of all my sound files. I had to write a second array with all their running times in seconds, then write a counter script and give it an extra 10 seconds or so, my Windows Media player seems to freeze up at the end of playing a file, don't know if yours does that too.
    Well, I've thought of something like that, and used it on a simpler project, but for this I don't quite have a way of obtaining the play times. I would have to use a file scripting object i guess. This media player uses files from the user's computer to keep the music to their taste as well as prevent long loads.


    And Frets, I'm just simply using the bgsound to play the files and managing them with js(arrays) and such. My only real problem is getting the player to go to the next song(and i have a function for this, because it is used when you hit the next button) after a song plays.


    And actually, justinbarneskin, I think you might help me solve my problem. Not with a simple solution, but I might just need to get a file scripting object to get the play time from the file(if i can get it to work) and then I'll just have a second array to use with the songs.
    "Given billions of tries, could a spilled bottle of ink ever fall into the words of Shakespeare?"

  7. #7
    Join Date
    Mar 2005
    Location
    Behind you...
    Posts
    966
    *** and sorry to anyone reading, i was referencing the FileSystemObject ActiveX Control used in Jscript.
    "Given billions of tries, could a spilled bottle of ink ever fall into the words of Shakespeare?"

  8. #8
    Join Date
    Jun 2004
    Posts
    390
    Simply use Flash's sound object. There is an onSoundComplete handler you can use.

  9. #9
    Join Date
    Feb 2005
    Posts
    1,018
    So you are just going to cater to IE users then? You do realize once you envoke the activex control security software is going to start going off.
    If you can't handle the job then don't take the job or ask for help on it if you are getting paid for it.
    Web Developer's Handbook.::.Why Tables for Layout is Stupid?.::.Why I won't help you

  10. #10
    Join Date
    Mar 2005
    Location
    Behind you...
    Posts
    966
    Aerospace_Eng_, I am not trying to 'cater' to IE users. I write the code that I can, and make it work for as many people as possible, but we both know that when using JS, there are some things you just can not do, and there are a lot of things that can only be done in IE. It may not be fair or right, and I know it really isn't a good thing, but sometimes there is nothing you can really do. It's either make it for IE users, or not at all...

    But I think I will start into Flash now using that handy link from schizo. It is the best solution since it will work in all browsers(or the most popular ones really). And it will be slightly more 'portable' if you understand what I mean.
    "Given billions of tries, could a spilled bottle of ink ever fall into the words of Shakespeare?"

  11. #11
    Join Date
    Oct 2006
    Posts
    939
    So how much money do you have to dole out if you want to start writing Flash?
    It's like the Adobe Reader, free to read but pay if you want to write?

  12. #12
    Join Date
    Feb 2005
    Posts
    1,018
    To purchase Flash 8 it costs about 699 Us dollars. There are alternatives that are a little cheaper. One that comes to mind is SwishMax. I think so-think makes a flash editor as well.

    Since you are going to try creating a flash mp3 player www.gotoandlearn.com is a good place to start. It has basic tutorials on creating a flash mp3 player. Its a visual as well as spoken, so no reading required.
    If you can't handle the job then don't take the job or ask for help on it if you are getting paid for it.
    Web Developer's Handbook.::.Why Tables for Layout is Stupid?.::.Why I won't help you

  13. #13
    Join Date
    Mar 2005
    Location
    Behind you...
    Posts
    966
    Thank you both. I know flash is expensive, but I actually already had Flash 8. I got Studio 8 a while back but I just couldn't get into flash that much. I just mainly used it for dreamweaver. But now I think i'm starting to like it.
    "Given billions of tries, could a spilled bottle of ink ever fall into the words of Shakespeare?"

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles