PDA

View Full Version : sound fader/mp3 player component



devonair
June 30th, 2005, 05:01 AM
never even noticed this forum section before.. very nice.. anyhow thought I'd share a component I just completed. It was meant to just stream in an array or xml file with a list of mp3's and allow the user to fade the sound out (or in) by clicking on the component.. Gradually though I added enough methods to make it a decent (albeit still simple) mp3 player..

anyway, the component is here:
http://www.onebyonedesign.com/downloads/OBO_SoundFader.zip

And an example .fla using it as a player is here:
http://www.onebyonedesign.com/downloads/sf_example.zip

Only works in the flash 7 player..

zephn
June 30th, 2005, 03:11 PM
strangly enough I can make it work and load into a webpage on my computer but not on my server when previewed in internet explorer or safari.
I use a simple command loadmovie ("soundfader.swf","mp3player"); to load it into my movie and on my pc it's woring great. I was able to manipulate the song selections, play it, mute it with fade, adjust volume etc.
The I uploaded it to my site and it's invisible.
Here is the test and you'll see it doesn't even show up. http://www.zephn.com/kirupa/testmp3.htm
Please forgive the site design being incomplete.

source files
http://www.zephn.com/kirupa/m.zip


edit: I think I just found the problem. I made my site using flash 6 and when i converted to publishing as flash 7 all my simple
loadmovie ("soundfader.swf","mp3player");
stoped working. Investigating now.

devonair
July 1st, 2005, 01:32 AM
Make sure you change "loadmovie" to "loadMovie" (flash being case sensitive these days)... that might help out..

kos010
July 6th, 2005, 11:07 AM
dear deavonair.
Thank youuuu sooooo ****in much! I was doing this mp3players thing for a salsa site, and before I knew I was fixing all kind of themes and styles just to give it a little bit that cuban feeling. This component is soooooo customizable, GREAT! :kir:

devonair
July 7th, 2005, 06:53 AM
Thank you for the comments, kos010.. glad it was useful.

kos010
July 12th, 2005, 09:52 AM
hi devonair, me again...
I was doing some mods to your mp3 player and I couldnt figure something out. I want to add a pause and a play button, but with all the tutorials and things I found regarding mp3 players, I'm not getting any further. Is it, because the functions are embedded in the compontent?
grts kos

devonair
July 13th, 2005, 02:59 AM
Sorry.. shoulda added some more detail.. These are all the methods available:

show()
unshow()
changeVolume(newVol)
getName()
nextSound()
prevSound()

And these are all the events broadcasted:

onClick
onSoundOn
onSoundOff
onNewSound

So, for example let's say you wanted to make the soundfader disappear when someone clicked it, you could say:

var myListener:Object = new Object();
myListener.onClick = function() {
my_sf.unshow();
};
my_sf.addEventListener("onClick", myListener);

a pause button really isn't necessary because when you use the component to stop your music, it starts again where it stopped - so the component itself really is a pause button..
hope that all made some sense and helped out..

sgiff
July 29th, 2005, 01:04 AM
I am sort of new to flash and I have been looking for a way to turn off the background sound that is playing when I play an FLV that has audio. So basically what I am wondering is whether I can control this component from another movieclip or frame through actionscript. So for example when my FLV starts playing and I want to activate the sound fade can I add a script from a frame in another part of my swf that will activate it?

s.g.