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: Profil Roxxy22
 | Femeie 19 ani Cluj cauta Barbat 25 - 48 ani |
|
CocaDozzer
Moderator
 Din: Garda de Fier
Inregistrat: acum 17 ani
Postari: 197
|
|
Create Your Own Music Player
A
Code:
var sound:Sound = new Sound();
// new sound object
var loaded:Number = 0;
// variable for how much is laoded
var soundPaused:Boolean = true;
//if we're paused
var soundPosition:Number = 0;
//position of the sound
sound.loadSound("http://www.mindless-games.com/files/musicplayer/cosmic.mp3", true);
//laoding the sound. Change the address to the address of the mp3
loadedBar._xscale = 0;
//for the loading bar
sound.stop();
//change the "soundPaused" variable to false and remove the line above if you want it to start automatically
function onEnterFrame() {
if (loadedBar._xscale != 100) {
loadedBar._xscale = Math.round(sound.getBytesLoaded()/sound.getBytesTotal()*100);
//like preloading an SWF but with the sound file
}
}
playBttn.onRelease = function() {
if (soundPaused) {
soundPaused = false;
sound.start(soundPosition, 1);
//when we press play start the song from where we started
}
};
pauseBttn.onRelease = function() {
if (!soundPaused) {
soundPaused = true;
soundPosition = sound.position/1000;
//get the sound position when we stop
sound.stop();
}
}; |
B
Code:
var sound:Sound = new Sound();
// new sound object
var loaded:Number = 0;
// variable for how much is laoded
var soundPaused:Boolean = true;
//if we're paused
var soundPosition:Number = 0;
//position of the sound
sound.loadSound("http://www.mindless-games.com/files/musicplayer/cosmic.mp3", true);
//laoding the sound. Change the address to the address of the mp3
loadedBar._xscale = 0;
//for the loading bar
sound.stop();
//change the "soundPaused" variable to false and remove the line above if you want it to start automatically
function onEnterFrame() {
if (loadedBar._xscale != 100) {
loadedBar._xscale = Math.round(sound.getBytesLoaded()/sound.getBytesTotal()*100);
//like preloading an SWF but with the sound file
}
sound.setVolume(slider._x-slider_bar._x);
//set the volume of the slider bar
}
playBttn.onRelease = function() {
if (soundPaused) {
soundPaused = false;
sound.start(soundPosition, 1);
//when we press play start the song from where we started
}
};
pauseBttn.onRelease = function() {
if (!soundPaused) {
soundPaused = true;
soundPosition = sound.position/1000;
//get the sound position when we stop
sound.stop();
}
};
stopBttn.onRelease = function() {
sound.stop();
//stop the sound
soundPosition = 0;
//the position of the sound is back to 0
}
slider.onPress = function() {
this.startDrag(false, slider_bar._x, this._y, slider_bar._x+slider_bar._width, this._y);
//move the slider along for volume
};
function onMouseUp() {
slider.stopDrag();
} |
_______________________________________
PM-URI
 
JUST SAY THANKS-it only takes a second!!!!
|
|
pus acum 16 ani |
|