PDA

View Full Version : can't disable auto play...


dsnyder
01-31-2008, 01:49 PM
I'm customizing a mp3 template and can't figure how to disable the auto play. I believe that I need to alter something in the following AS but I can't figure it out. Any help?

THANKS!

//playpause buttons
if (playing) {
PlayPauseButton.PauseButton._visible = true;
PlayPauseButton.PlayButton._visible = false;
} else {
PlayPauseButton.PauseButton._visible = false;
PlayPauseButton.PlayButton._visible = true;
}

//function for loading a new song to play
function loadSong(num) {
delete theSong;
theSong = new Sound();
currentSong = num;
//set right title
trackbar.track_title.text = allSongs[num]["title"];
//load song
theSong.loadSound(allSongs[num]["songURL"],true);
playing = true;
theSong.start(0);
//go to next song oncomplete
theSong.onSoundComplete = function() {
//go to next song
currentSong += 1;
//if you are at the last song, go to the first
if (currentSong>=allSongs.length) {
currentSong = 0;
}
loadSong(currentSong);
};
}

//Buttons
PlayPauseButton.PlayButton.onPress = function() {
theSong.start(rememberPosition/1000);
playing = true;
};

PlayPauseButton.PauseButton.onPress = function() {
rememberPosition = theSong.position;
theSong.stop();
playing = false;
};

davidj
01-31-2008, 03:11 PM
where you have

playing = true;

you could try

playing = false;

domedia
01-31-2008, 04:50 PM
That's from the onPress event david...

davidj
01-31-2008, 05:00 PM
its also from the loadSong() function

i imagine that this is called initially

domedia
01-31-2008, 05:05 PM
yes, my bad. Nice, now dsnyder knows not to disable the play button at least ;)