I’m trying to construct an MP3 audio player that when the user clicks on one of the audio clips a Dynamic Text box comes up saying “Downloading…”. Problem is that the Dynamic Text stays on the screen after the song has loaded. Currently there is also an “else” statement that shows “Song Loaded” if the screen is refreshed after a period of time. Question? How do I get the Dynamic Text to disappear when the audio is cached and have the audio start to play?
Currently my script is as follows:
First Frame Action Script:
mySound = new Sound(audio);
// create a sound object
mySound.loadSound("test.mp3", true);
// attach and cache external sound file
mySound.stop();
// stop sound object from playing
Play Button Action Script:
on (press) {
downloaded = mySound.getBytesLoaded(audio);
total = mySound.getBytesTotal(audio);
if (downloaded != total) {
textbox = "downloading song...";
// textbox is the text area
} else {
textbox = "Song Loaded";
// textbox is the text area
mySound.loadSound("test.mp3", true);
// The audio should start to play here
}
}
I’ve also reviewed the excellent work by Kenny Bellew at http://www.kennybellew.com/ but have not found anything that I am looking for.
If you wanted to see this in action go to the following URL
http://www.aull.com/test/test.html
Thanks in advance for all the help!
:-\