Build Simple Sound Player: Flash Tutorial AS 3.0
Flash Tutorials
25th Feb 2010
25 Comments »
Check this video out at Hi-Res here: www.tutvid.com In this video we will connect aa play and pause button to an external source of sound. We will get the sound both from our hard drive and from the live web and build a mini sound player with a simple play and stop button! We will be using Actionscrip 3.0 and learning about urlrequests as well as the Sound, soundmixer, and soundchannel classes. Please check out the site www.tutvid.com


good sound player tutorial for every body
thanks
wtf???
wow your my hero…
TheMightySlusk , I check this tutorial out also in CS4. and I found a solution. You have to change this line:
sndTrans=thisSnd.stop();
on this one:
sndTrans.stop();
There’s no change, it’s still AS3
OMG i got loads of adobe products and didnt have a clue wat to do with them, i got:
Flash, Soundbooth, Photoshop Extended, captivate, after effects, illustrator!
now just 1 week later i can do shitloads of stuff thanks to you!
I SUBSCRIBED and RATED MOST, IF NOT ALL OF YOUR VIDS 5*
i just wanna say thanks you know!
Please how about to add a Second music on it.
I have been trying. but if add in the same frame, there is errors.
do it as:
addEventListener(Event.ENTER_FRAME,playM);
then define the function…
function playM(e:Event):void{
sndTrans = sound.play();
}
… I’m getting the “null object or reference” error with the stop button though X(
does any1 know if there should be any changes in the action script if you use flash cs4? its not working for me :/
Nice Tutorial! Too bad I knew this already. LOL.
Answer to julianic81:
Add that play function right after the load function and change that first stop_btn.visible in between the button event listeners to play_btn.visible = false;
can you make a track tutorial.
this is beautiful thank for sharing this with us but a I have one question how I can have the sound playing auto! thank you for your help!!
3.0 are cooler.
Do you know hot to make a movieclip when is being in hitTest to play a sound???
I tryed this: if(_root.mpla.hitTest(this)){load(Sound)}
but didn’t worked.. Do you know the code for playing sounds?
I have seen many of your videos an I have to say your are very good at explaining things
In your tutorials
I got this Error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
Can some1 help me with this!!!???
thanks a lot for this tut helped a lot. quality on youtube sucks though high quality one was much easyer to view the text.
Thanks this really helped!!
Note: To those who are getting the file stream error you have to import the sound file into the stage NOT the library.
Do this by going to:
File>Import>Import to Stage, then just go to your sound file.
AND you MUST MUST MUST save your file. After you’ce saved it, then preview your mp3 player and it WILL work. I had the very same problem with streaming etc.
Hope this helps!
If you have anymore questions about streaming etc. feel free to mail me.
there are alot of problems with it (notably preloaders) but it is more powerful and newer in general
2.0 is easier.
Why?
3.0 is not as good as 2.0
I get this because i have only AS 2
**Error** Scene=Scene 1, layer=AS, frame=147:Line 1: Operator ‘=’ must be followed by an operand
var loadSnd; URLRequest = new URLRequest(*5.Where i may Roam.mp3*)
Total ActionScript Errors: 1 Reported Errors: 1
Arigato Gozaimasu!