Skip navigation
Currently Being Moderated

Toggle play / stop button for Dreamweaver

Aug 2, 2012 4:36 PM

Hey guys, I've been looking for an answer for a few hours and I can't find one, so here's the deal:


I have a long list of .mp3 songs (about 100).  I'd like to add a play / stop toggle button next to each song (like iTunes) so the viewer can play and stop the song (like a preview of the song).  What is the best way to do this in Dreamweaver CS4?  Do I need to create this in Flash then import into DW?





  • Currently Being Moderated
    Aug 2, 2012 4:56 PM   in reply to S.Solan

    1) you can do this in Flash and it's not that hard.  Do a search engine search for Flash MP3 Player and you will find some tutorials


    2) you can do this without Flash and just use HTML5 but again you will have to do a websearch for HTML5 MP3 Player.  There are plenty of tutorials.  If you choose this method you will have to use Javascript or jQuery for the logic part of the play and stop function.  Otherwise in Flash you will be using ActionScript 3.0 .

    Mark as:
  • Currently Being Moderated
    Aug 2, 2012 9:03 PM   in reply to S.Solan

    I'm not sure I understand your question.  Are you assuming that each time the page loads every song will play one after the other without the user interacting with the page?  Or are you asking that the page would preload every song prior to hitting the play button by the user?


    If it's the latter, not to worry.  The javascript (for html5) and actionscript code (if you're using flash) can be written such that nothing loads unless the user hits the play button.  With fast internet connections preloading won't be a big problem and once the page has been cached and the song has been cached it won't have to preload again if the user decides to replay the song.  The only thing you would have to worry about is if the user deletes the browser's cache while interacting with your page.

    Mark as:
  • Currently Being Moderated
    Aug 3, 2012 6:44 PM   in reply to S.Solan

    To answer those questions you would best be off to the Flash Professional Forum (in fact there is an ActionScript 3.0 forum) and the experts there can help you out with the necessary code.  I am saying this since you have already begun to do the work in Flash in terms of interactivity rather than choosing to do a javascript enabled button using HTML5 and javascript.  You would not do this stuff in Dreamweaver unless you were to code in javascript rather than actionscript.

    Mark as:
  • Currently Being Moderated
    Aug 3, 2012 7:23 PM   in reply to S.Solan

    That's a very good question.  The first question I have for you is are all of your songs your own copyright-owned songs?  In other words did you create the entire content of each song? Or are you licensed to distribute the songs?  (distribution includes posting them online)


    If so, then read on.


    What I would do is either

    1)  Create a Flash version which is much more robust in this day than the HTML5 players that I've seen.  You can use an XML list (which you can probably do for HTML5 as well but I haven't seen good examples) and thus populate your mp3 player dynamically so that you don't have to recode in Flash every time you want to change your playlist.  Then provide a download link for each song for people viewing on iPad or iPhone or Android Jellybean (which won't be supporting Flash Player either I have heard)

    2)  Create an entirely HTML5 version

    3)  Post your songs on iTunes and AmazonMP3 using a music distribution service and sell your albums.

    4) Use a hosting service for music files such as "soundclick" or "soundcloud"

    Mark as:
  • Currently Being Moderated
    Aug 4, 2012 11:27 AM   in reply to S.Solan

    you can do all of that with both Flash with Actionscript 3.0 and HTML5 with Javascript.  But you have to do the research yourself to see if you find examples that would suit you best.  I find it easier in Flash because I'm more comfortable with it but many people are moving away from Flash.  If you want it viewed on a tablet i would recommend HTML5.  If it's just for a desktop or laptop then Flash.  I can't give you the code because it's involved and someone in the Flash section of this forum can be of better assistance than myself.  It is not difficult to implement a scenario where the new song stops the old song from playing and starts to play itself.  The suggestions I gave above were not just picked out of thin air but carefully thought of from experience.

    Mark as:
  • Currently Being Moderated
    Aug 4, 2012 3:11 PM   in reply to S.Solan

    Flash is practically a dead web technology.  Adobe no longer supports Flash development on mobile devices.


    That said, if Adobe has abandoned Flash for mobiles, ask yourself who your site's target audience is.   I'll admit, Flash audio is nicer than HTML5<audio> but in the end, it doesn't matter if nobody can hear it.


    Another way to look at it:  Are you building this site for a short term existence (6-12 mos) or a long term one (2-3 years)?


    If long term, use HTML5.



    Nancy O.

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points