beautyfarm - THE BEST DESIGN
DOWNLOAD MY MUSIK,participa la concursuri,soft-uri,cool stuff,NIKON CLUB,Baruri Trendy,ScreenSavers,Accesorii Cool,Masini sexy,Bannere,Games,Aparitii Cinematografice,Tribal Farm...etc distreaza-te!Totul pentru TINE.Cele mai tari subiecte.
|
Lista Forumurilor Pe Tematici
|
beautyfarm - THE BEST DESIGN | Inregistrare | Login
POZE BEAUTYFARM - THE BEST DESIGN
Nu sunteti logat.
|
Nou pe simpatie: swiss_virginia pe Simpatie
| Femeie 25 ani Cluj cauta Barbat 27 - 54 ani |
|
CocaDozzer
Moderator
Din: Garda de Fier
Inregistrat: acum 16 ani
Postari: 197
|
|
Create Your Own Music Player in flash
Lets make a new (AS2) document. Now we want to make a play and stop button, with the instance names of playBttn and stopBttn. We’ll also have a loading bar with the insatnce name of loadedBar.
What we’re going to do is have a loading bar whilst we’re streaming the sound with a play and pause button. Nothing tricky yet.
view A
So what’s happening? We’re creating a sound object which we use to attach the sound to. The address there can be anything you want to stream. Then we start loading it (very similar to preloading an SWF).
What we do is when the sound is paused, we can press the play button; when it isn’t, we can press the pause button. Then we start the sound the same way we do with any sound in actionscript. However you may notice we start from the variable soundPosition. This is so we know where to start from once we’ve paused it.
To get the position of the sound we use sound.position. However that returns the position in milliseconds, which is why we divide by 1000. When we start the sound it has to be in seconds, not milliseconds.
Simple enough? Now lets add a volume bar and stop button. Give the stop button the instance name of stopBttn. For the volume bar we want a little slider, with the instance name of slider, and a bar underneath it (which it will slide along) with the instance name of slider_bar. Some actions!
view B
What’s changed? Well we have a stop button, which stops the sound and sets the position of the sound back to 0. Then on the onEnterFrame part we use setVolume. This sets the volume of a number from 0-100 that you put in. So we set the volume to be slider._x-slider_bar._x. Therefore as the slider moves to the right the volume increases.
_______________________________________ PM-URI
JUST SAY THANKS-it only takes a second!!!!
|
|
pus acum 15 ani |
|