Thanks so much! I wanted my audio file to play automatically upon page load, and was able to do that as well!! Mr. Tutvid - you've always been a HUGE HELP, and you're a great teacher!!! Thank you!
would it be possibel for you to make one where you press a button and it shows a radom number and plays that random numbers sound, i want to make a game that teaches spanish, i want to do this with numbers days week and months, i just need coding for pressing a button and say 10 random numbers play and display them numbers,
What line(s) in the code do I change if I want it to autoplay? So when the page loads the music starts then they use the buttons to start or stop it as they wish? Thanks.
Oh. My. Good. God. You Sir just saved my life. I spent 5 hours going crazy until 6am the other day trying to solve this problem. I'd created two buttons to play and pause but the play button kept overlaying new sounds and the pause button wouldn't cause any action. I now love SoundMixer.stopAll();
I have several player-buttons on my page. How do I stop all sounds when I press play on one of the other buttons? I've tried this:
Code:
import flash.media.SoundMixer;
SoundMixer.stopAll();
but it doesn't work out. Do I need to number the players somehow?
Also, when the MP3 has finished playing it should turn into a play button. As of right now it's a stop-button when it's finished playing. How do I change it to a play-button?
How do you do this with a sound file in the library? I'd really appreciate knowing because URLs can be very risky because 1. No one has what you put on their computer or in the same locale. 2. Websites can change at anytime.
@SalvationStudios1 just save the flash project in the same folder as the file i guess, it worked for me... this was a year ago you asked lmao you probly figured it out by now
I need your help - I am trying to make a movie and I want it so that when i click the start movie button it will go to a different frame and play a different sound. I have both sounds in the library and I don't want to start over. Please help
Just a quick question though, when the sound finishes, is it possible to make it so the button changes again? I mean, when the sound finishes, I wantes it to either loop the sound till the user click stop, OR have it so the play button comes up again when the sound it over. Please help!!! :)
@Iglitchlife how do you have adobe shit if you didnt know what to do with em, there like professional software, you just torrent random shit that you see on the internet?
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;
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.
**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*)
ok i have copyed and pasted the code for the play button and changed what needed to be changed. So all should be running well. But it doesnt instead every time i click test movie i get an error that says i need an ending ) or a , on the line about Play.addEventListener(Mouse Event.CLICK,playF) can some one help me, oh and i am using AS3.0 but it does the same in AS2.0 and AS1.0
ifound out how, u have to put a new variable that holds the position that way when u press play againd it will resume from the position that was paused
why everyone wanna make this look so hard?!?! its seriusly easy just do 2 buttons and other where it stop music and where it starts it. just put sounds in that button and stop script :/
Awesome TuT.... Got a question for u Have ever I have flash 5 (LOL) isthere a way for this to work or is there a way to do this in 5 at all and/or create a player period in 5 ??
Alright for all you guys out there that are having problems with the coding there is only one issue im having is on line 8 thisSnd.play() but i will post the script without that and there are no errors as i checked it throughly
You just ended 13 hours of frustration coupled with misery and despair! Very good stuff. Unbelievable how hard it can be to find something on elementary AS like this. Took me long before I found this great vid.
it might be becuase you are using the wrong type of actioscript, this MUST be action script 3 (only available in adobe flash CS3). If not then you may have made a typing error, have look, if not then i dont know what it could be
I have got the same problem and I am using actionscript 3 and I didn't type errors ( I copy paste your code) ! I don't understand what's the problem :(
yeah i got something similar. i think it has to do with name or location of the sound file on your HD, however when i placed a sound from the net it worked.
Thanks so much! I wanted my audio file to play automatically upon page load, and was able to do that as well!! Mr. Tutvid - you've always been a HUGE HELP, and you're a great teacher!!! Thank you!
televisionteevee 4 days ago
would it be possibel for you to make one where you press a button and it shows a radom number and plays that random numbers sound, i want to make a game that teaches spanish, i want to do this with numbers days week and months, i just need coding for pressing a button and say 10 random numbers play and display them numbers,
Thanks
nalgazo 3 months ago
What line(s) in the code do I change if I want it to autoplay? So when the page loads the music starts then they use the buttons to start or stop it as they wish? Thanks.
ryanfc 4 months ago
can you add that to your website? i like to create one for my web
ProtocolsMaster 7 months ago
SecurityError: Error #2000: Kein aktiver Sicherheitskontext.
ArgumentError: Error #2068: Ungültiger Sound. at flash.media::Sound/play() at Untitled_fla::MainTimeline/playF()
Regnator1 7 months ago
SecurityError: Error #2000: Kein aktiver Sicherheitskontext.
ArgumentError: Error #2068: Ungültiger Sound. at flash.media::Sound/play() at Untitled_fla::MainTimeline/playF()
need Help (I use Adobe Flash CS5.5)
Regnator1 7 months ago
Thank You Very Much
SaDoFaAnimation 10 months ago
thnx very much
TusharVatsa31 11 months ago
superb work bro
TusharVatsa31 11 months ago
this is very cool :) thx for help.
alexandruagapi 1 year ago
Oh. My. Good. God. You Sir just saved my life. I spent 5 hours going crazy until 6am the other day trying to solve this problem. I'd created two buttons to play and pause but the play button kept overlaying new sounds and the pause button wouldn't cause any action. I now love SoundMixer.stopAll();
RELIEF!
swedenips 1 year ago
WARNING: Actions on button or MovieClip instances are not supported in ActionScript 3.0. All scripts on object instances will be ignored.
HELP!!!
i try to change it to 1.0/2.0 but it just has a ton of errors!!
Kittycatnya12367 1 year ago
Comment removed
Kittycatnya12367 1 year ago
Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error. at Untitled_fla::MainTimeline/Untitled_fla::frame1()
ArgumentError: Error #2068: Invalid sound. at flash.media::Sound/play() at Untitled_fla::MainTimeline/playF()
ArgumentError: Error #2068: Invalid sound. at flash.media::Sound/play() at Untitled_fla::MainTimeline/playF()
ArgumentError: Error #2068: Invalid sound. at flash.media::Sound/play() at Untitled_fla::MainTimeline/playF()
ERROR please help!!
kennybenny17 1 year ago
how do i make it a pause function instead of a stop? i tried pauseF instead of stopF and replaced all of the (stop)s with (pause)s... please help!
bers0044 1 year ago
Thanks a million!
blagmusic 1 year ago
For all those that got compiler errors - you must have the sound files in the same folder as your flash file
aqcheryl 1 year ago
REQUEST TUTORIAL
MP3 player with playlist in flash AS2
:)
sammysroutee66 1 year ago
I have several player-buttons on my page. How do I stop all sounds when I press play on one of the other buttons? I've tried this:
Code:
import flash.media.SoundMixer;
SoundMixer.stopAll();
but it doesn't work out. Do I need to number the players somehow?
Also, when the MP3 has finished playing it should turn into a play button. As of right now it's a stop-button when it's finished playing. How do I change it to a play-button?
sciologos 1 year ago
How do you do this with a sound file in the library? I'd really appreciate knowing because URLs can be very risky because 1. No one has what you put on their computer or in the same locale. 2. Websites can change at anytime.
SalvationStudios1 1 year ago 6
@SalvationStudios1 just save the flash project in the same folder as the file i guess, it worked for me... this was a year ago you asked lmao you probly figured it out by now
MisterMarmatote 4 months ago in playlist Flash Tutorials
I need your help - I am trying to make a movie and I want it so that when i click the start movie button it will go to a different frame and play a different sound. I have both sounds in the library and I don't want to start over. Please help
warface21 1 year ago
how can i make this play automaticly..?
like "autoplay" when i open the player :)
Thx
KbhAllStars 1 year ago 3
@KbhAllStars hi brother
did you got the help with ?
it happen the same with me
i wanna it plays automaticly and loop for ever till i press stop...
i if get the help with let me know please
or anybody know's please help me
thank a million...
rockomoron 1 year ago
Mine said in the errors list it said:
ArgumentError: Error #2068: Invalid sound.
at flash.media::Sound/play()
at PLayer2_fla::MainTimeline/playF()
What is wrong?
BurningArtsStudios 1 year ago
Hi thanks for the video, very helpful indeed!!!
Just a quick question though, when the sound finishes, is it possible to make it so the button changes again? I mean, when the sound finishes, I wantes it to either loop the sound till the user click stop, OR have it so the play button comes up again when the sound it over. Please help!!! :)
BeckySilva08 1 year ago
I did it like this, there is probably an easier way though.
var myTimer:Timer = new Timer(lenght of the song in miliseconds);
myTimer.addEventListener(TimerEvent.TIMER,stopFT);
function stopFT(event:TimerEvent):void{ stop_btn.visible = false;
play_btn.visible = true;
myTimer.stop();
}
oh, and put a myTimer.start(); in the playF function and myTimer.stop(); in the stopF function
hibludij 1 year ago
thank you so much, I'm gonna try that.. :)
BeckySilva08 1 year ago
@hibludij Hey I'm reading your comment it's interesting...
a question
How do i keep looping the sound ?
because when the it ends it stop by itself but the animation keeps playing bout the sound stops can you help me how to set for looping please ...
rockomoron 1 year ago
Comment removed
hibludij 1 year ago
how i can made a pause buton for this loader? plz some help
Warlockxp 1 year ago
good sound player tutorial for every body
manharanlal 2 years ago
thanks
spydi3 2 years ago
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! :)
Iglitchlife 2 years ago 10
wow your my hero...
bellasooky 2 years ago
wtf???
Iglitchlife 2 years ago
@Iglitchlife how do you have adobe shit if you didnt know what to do with em, there like professional software, you just torrent random shit that you see on the internet?
MisterMarmatote 4 months ago in playlist Flash Tutorials
Comment removed
djmatche 2 years ago
Please how about to add a Second music on it.
I have been trying. but if add in the same frame, there is errors.
djmatche 2 years ago
does any1 know if there should be any changes in the action script if you use flash cs4? its not working for me :/
TheMightySlusk 2 years ago
There's no change, it's still AS3
spima 2 years ago
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();
ir3nicus 2 years ago
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;
mansion10000 2 years ago
can you make a track tutorial.
MrTrianglz 2 years ago
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!!
julianic81 2 years ago
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?
SwordSkill2 2 years ago
I have seen many of your videos an I have to say your are very good at explaining things
In your tutorials
PrettyPrincezz100 2 years ago
I got this Error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
Can some1 help me with this!!!???
kellthusad 2 years ago
thanks a lot for this tut helped a lot. quality on youtube sucks though high quality one was much easyer to view the text.
steveinater 2 years ago
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.
MGSFan09 2 years ago
Comment removed
MGSFan09 2 years ago
3.0 is not as good as 2.0
superfly100088 2 years ago
Why?
DJBassEnergy 2 years ago
2.0 is easier.
superfly100088 2 years ago
there are alot of problems with it (notably preloaders) but it is more powerful and newer in general
walkerm930 2 years ago
3.0 are cooler.
leonelc29 2 years ago
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
TheArtOfGames 2 years ago
Arigato Gozaimasu!
sendono 2 years ago
finally, someone without a squeeky voice! now i dont feel dumb.
thanks alot for this video m8, helped alot!
bananarchy1 2 years ago
ok i have copyed and pasted the code for the play button and changed what needed to be changed. So all should be running well. But it doesnt instead every time i click test movie i get an error that says i need an ending ) or a , on the line about Play.addEventListener(Mouse Event.CLICK,playF) can some one help me, oh and i am using AS3.0 but it does the same in AS2.0 and AS1.0
bonecrusher8301 2 years ago
I got same problem
any help???
salaamst 2 years ago
ifound out how, u have to put a new variable that holds the position that way when u press play againd it will resume from the position that was paused
thx anyway
maddoggy2me 2 years ago
anyone knows how to pause a sound? cuz the stop function will stop it and when i hit play the sounds restarts
thx
maddoggy2me 2 years ago
in set of stop put pause
Carlosgutierrez88 2 years ago
why everyone wanna make this look so hard?!?! its seriusly easy just do 2 buttons and other where it stop music and where it starts it. just put sounds in that button and stop script :/
stickmister321 3 years ago
THANK YOU!
reniett 2 years ago
so ac3 is a step up from ac2 why? i thought this would be simpler..
nonamist 3 years ago
i know right?
HaLO3gamer91 2 years ago
Awesome TuT.... Got a question for u Have ever I have flash 5 (LOL) isthere a way for this to work or is there a way to do this in 5 at all and/or create a player period in 5 ??
oboyisreal 3 years ago
this is awesome. you would probably get a lot of listeners if u made a podcast.
theinstantramen 3 years ago
Man, I love tutvid tutorials. Crystal clear and very helpful.
varnol 3 years ago
I fixed it okay here is the whole script with no errors
var loadSnd:URLRequest = new URLRequest("your .mp3 file");
var thisSnd:Sound = new Sound();
thisSnd.load(loadSnd);
your button name.addEventListener(MouseEvent.CLICK,playF)
function playF(event:MouseEvent):void{
thisSnd.play();
}
HIDDENDARKNESS727 3 years ago
Alright for all you guys out there that are having problems with the coding there is only one issue im having is on line 8 thisSnd.play() but i will post the script without that and there are no errors as i checked it throughly
var loadSnd:URLRequest = new URLRequest("");
var thisSnd:Sound = new Sound();
thisSnd.load(loadSnd);
playbtm.addEventListener(MouseEvent.CLICK,playF)
function playF(event:MouseEvent);void{
}
HIDDENDARKNESS727 3 years ago
Um i know it's gonna be hard but can eny 1 type out the actions at 4:51 secs plz?? cuz i cant get um right
TheTimeLord903 3 years ago
Thanks for tutorial) realy helpful
MindFreakTheMon 3 years ago
2nd that
orgatecmass 3 years ago
can someone copy and paste this codes in the comment thanks that will help some one who is a blind person
Timbasonlaoriginal 3 years ago
I second that. O.O I cannot get it.. so many errors. x.x -might be blind- LOL
spookykittor 3 years ago
You just ended 13 hours of frustration coupled with misery and despair! Very good stuff. Unbelievable how hard it can be to find something on elementary AS like this. Took me long before I found this great vid.
olovkallgarn 3 years ago
I've tried this, when I press play I get this:
Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error. at player_fla::MainTimeline/player_fla::frame1()
ArgumentError: Error #2068: Invalid sound. at flash.media::Sound/play() at player_fla::MainTimeline/playF()
Any ideas anyone?
Hypn0dude 3 years ago
it might be becuase you are using the wrong type of actioscript, this MUST be action script 3 (only available in adobe flash CS3). If not then you may have made a typing error, have look, if not then i dont know what it could be
DaFobKing 3 years ago
I have got the same problem and I am using actionscript 3 and I didn't type errors ( I copy paste your code) ! I don't understand what's the problem :(
gabriela842004 3 years ago
erm.....¬¬ u nid actionscript 2.0 mate not 3.0
i don't know why, its just the way to use actionscript in action 2 is better or (noy sure) easier than actionscript 3.0 i think.
Try actionscript 2.0 and see what happens, ya?
HearGongOut 2 years ago
yeah i got something similar. i think it has to do with name or location of the sound file on your HD, however when i placed a sound from the net it worked.
schopenhauerjr 3 years ago
Hi I just wanna know if can do that in Flash 8?
and if you put here AS ?
thanx
Lu1as 3 years ago
Great stuff! any idea how to make the music start playing automatically after loading without having to hit play? Thanks heaps Nate!
anthonyjaisingh 3 years ago
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(
nosferotica1 2 years ago
Really great tutorial, thanks much!
eimanz 3 years ago
they make the best tutorials ever... and he's so profesional and have a pleasant voice.
Snipto 3 years ago 2
what is that black thingy where all you sound files are?
What is it called at whats the hotkey??
flashmaggot 3 years ago
i think it adobe Bridge i've got it with flash i thougth but i don't know.
jnbjabnk 3 years ago
DUDE were u learned all this stuff??
chttli 3 years ago
thanks mate, after that i figured out that it was in AS 3.0 lol i was sweet! nice and easy!
swedishkiwi 3 years ago
Hey this is Wonderboss if you cant tell from my name.
I am a new animator just got into it and want to make a flash for my friends site for plugs on the internet.
So here is my question, How do i make a play button, for instance play as in play the cartoon I created.
wonderboss 3 years ago
where is this location you are right now,flash or dreamweaver?i cant find it on flash and its a bit difficult for me to start with your tutorial.
timmynaija 3 years ago
where is this location you are right now,flash or dreamweaver?i cant find it on flash and its a bit difficult for me to start with your tutorial.
timmynaija 3 years ago
nice one
KillPie 3 years ago
Awesome!
pulkitgera 3 years ago
thanks man great tut your the best
Stefan1826MV2 3 years ago