# Creating a Flash Audio Player (need help)

**URL:** <https://forum.kirupa.com/t/creating-a-flash-audio-player-need-help/2706>\
**Category:** flash\
**Created:** [May 2, 2002, 4:29am UTC](https://forum.kirupa.com/t/creating-a-flash-audio-player-need-help/2706 "2002-05-02T04:29:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 2, 2002, 4:29am UTC](https://forum.kirupa.com/t/creating-a-flash-audio-player-need-help/2706/1 "2002-05-02T04:29:58Z")

</div>

What im trying to do: well basically I want to create an audio player in flash. I would like for it to have buttons for next and previous track, pause, stop, play, and display song info.\r\rBasically the one here at the bottom of the page:\r[www.basement-life.com](http://www.basement-life.com)\r\r\rSo what I got down at this point:\r\r-Creating stop and play buttons that load/unload external swf files that contain the song.\r\r-Show track info.\r\r-Thats it 🙂 \r\r\rWhat I need help with:\r\r-Creating next/previous track buttons so I can rotate between more than one song.\r\r-Pause button.\r\r\rIf anyone could point me to good tuturial for doing such a thing a would really appreciate as I haven’t ran across one yet.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 2, 2002, 4:50am UTC](https://forum.kirupa.com/t/creating-a-flash-audio-player-need-help/2706/2 "2002-05-02T04:50:17Z")

</div>

Ok someone posted some code on another forum but I cant get it working. For the pause button they suggested the following ActionScript:\r\ron (release) { \r\_level2.stop(); \r} \r\rThat didn’t seem to work.\r\rHeres the ActionScript for my stop & play buttons:\r\r-Play\r\ron (release) {\r loadMovieNum (“song1.swf”, 1);\r}\r\r\r-Stop\r\ron (release) {\r unloadMovieNum (1);\r}\r\r

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 2, 2002, 5:33am UTC](https://forum.kirupa.com/t/creating-a-flash-audio-player-need-help/2706/3 "2002-05-02T05:33:00Z")

</div>

A pause button is actually a little bit complex… and I don’t know how to do it, other than the principles involved. For what it’s worth this is how it’s done.\r\rA pause button must judge how far into a song it is by having a counter which is triped when the song starts, then again when the pause button is pressed.\r\rThen you use stopAllSounds(); to stop the music from playing.\r\rThen when you hit pause again, it needs to start playing the song a number of milliseconds into it equal to the second counter minus the first counter.\r\rAs far as I know there is no other way of doing what you’re talking about, UNLESS they’ve altered things in Flash MX.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 2, 2002, 10:23pm UTC](https://forum.kirupa.com/t/creating-a-flash-audio-player-need-help/2706/4 "2002-05-02T22:23:54Z")

</div>

that method will work just fine assuming song1.swf contains a sound set to streaming and enough frames as the sound is long.\r\rbut you’re loading it into level1 and telling level2 to stop!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 3, 2002, 2:21am UTC](https://forum.kirupa.com/t/creating-a-flash-audio-player-need-help/2706/5 "2002-05-03T02:21:44Z")

</div>

Ya I changed it to level1 - and it does stop the song but it doesnt pause it.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 3, 2002, 3:06pm UTC](https://forum.kirupa.com/t/creating-a-flash-audio-player-need-help/2706/6 "2002-05-03T15:06:40Z")

</div>

sorry, no comprendo. stops but doesn’t pause? \r\rdo you mean that \_level1.play(); doesn’t restart it?
