| Welcome to Brackenwood. We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| Sound control; Pause play and stop sounds | |
|---|---|
| Tweet Topic Started: Mar 28 2006, 04:19 AM (232 Views) | |
| juggleballz | Mar 28 2006, 04:19 AM Post #1 |
|
I'm loose, full of juice and ready for use!
|
This is confusing the life out of me. Say i have a button that once clicked, an external Movie clip is loaded into flash. This external movieclip is a media player, with play pause and stop buttons. the sound plays automatically with the code..."attachsound" etc. as the sound clip is not actually inside a movie clip and it playing straight from the library, is it possible to pause it, rewind it, or adjust the volume using a slider, or does it have to be placed in a movieclip? if it is i wud be soooooooo grateful if someone could help me out. thanks you guys. |
![]() |
|
| smoscar_01 | Mar 28 2006, 09:00 AM Post #2 |
|
Mid-Level ActionScripter
|
hi juggz
:lol: it can be done with the next lines:
and then controlling your sound with snd.stop(); Note remember to link your sound to ActionScript
|
![]() |
|
| juggleballz | Mar 28 2006, 09:35 AM Post #3 |
|
I'm loose, full of juice and ready for use!
|
thanks smoscar, i got that bit already. im wondering if u can control the volume with a slider, also pause it... cheers for helping dude |
![]() |
|
| smoscar_01 | Mar 28 2006, 10:09 AM Post #4 |
|
Mid-Level ActionScripter
|
first add a button to your scene (this is going to be your volume slider) and add this code to it
then you are gonna have to add a setVolume action like this
and thats going to do the trick
|
![]() |
|
| juggleballz | Mar 28 2006, 08:57 PM Post #5 |
|
I'm loose, full of juice and ready for use!
|
i also need it so when u press play, it plays the sound but ony once... In other words, when i press play it plays the song, if i press play again, the song duplicates and u can hear two of the same song playing, and if i press it a 100 times, u can hear 100 songs playing, and thats not good. plus can u pause it with simple code? and once pressing play allow it to play from that position again? If this is impossible, what i can do is have a media player with a movieclip embedded in it with the sound in it....i dunno, media players are difficult. |
![]() |
|
| smoscar_01 | Mar 29 2006, 01:38 PM Post #6 |
|
Mid-Level ActionScripter
|
yeah it can be easily done lets say that you have a var called pos wich is going to be the actual position when paused of the sound so lets say you have a pause button:
and then you need to have this at the play button
so then when you 'pause' it you are really stoping it and recording the position value of the sound so when you play it again it can know where to start from
you can disable the play button once it is pressed and enable it only if stop or pause is pressed, something like this...
and at the stop button enable it again
|
![]() |
|
| juggleballz | Mar 29 2006, 08:00 PM Post #7 |
|
I'm loose, full of juice and ready for use!
|
smoscar man! thankyou makes sense. Its quite logical! How the hell do u remember that? I find it difficult remember what goes where etc. Thnaks a million smoscar dude! hopefully will work but knowing me, I will be back here to annoy you for help once again lol. Cheers mate. (smoscar for motm...
:lol: )
|
![]() |
|
| smoscar_01 | Mar 30 2006, 10:57 AM Post #8 |
|
Mid-Level ActionScripter
|
:lol: I dont know all of them by heart what I do is write: var myobject:Sound; myobject. and wait for the display list of properties and methods of each object, in this case of a Sound object but as soon as you type myobject: another display list of posible objects will appear for you
Dont worry it isnt an annoyment :lol: |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Actionscript · Next Topic » |






5:11 AM Jul 12