AtomicChip
Programmer
Here's yet another question 
I have a movie clip that's acting as a jukebox of sorts. I've been able to successfully add the functionality in to play and switch songs. Now what I'd like to be able to do is start the jukebox playing as soon as it's loaded onto the parent scene.
I tried adding a method to the jukebox movie clip like this:
But for some reason, the method will execute, but won't actually play anything. Any ideas why?
Also, I tried calling this method from the parent scene by adding this code to the instantiated object:
That didn't work, so I also tried this.playNextTrack() and others.
I'm pretty much pulling my hair out over this.
Any takers?
-----------------------------------------------
"The night sky over the planet Krikkit is the least interesting sight in the entire universe."
-Hitch Hiker's Guide To The Galaxy
I have a movie clip that's acting as a jukebox of sorts. I've been able to successfully add the functionality in to play and switch songs. Now what I'd like to be able to do is start the jukebox playing as soon as it's loaded onto the parent scene.
I tried adding a method to the jukebox movie clip like this:
Code:
var i = 1;
function playNextTrack()
{
var s = new Sound();
s.loadSound("audio/track0" + i + ".mp3", true);
// Set next track_id
if(i == 2) // There are only two songs right now
{
i = 1;
}
else
{
i++;
}
}
But for some reason, the method will execute, but won't actually play anything. Any ideas why?
Also, I tried calling this method from the parent scene by adding this code to the instantiated object:
Code:
onClipEvent(load)
{
_child.playNextTrack();
}
That didn't work, so I also tried this.playNextTrack() and others.
I'm pretty much pulling my hair out over this.
Any takers?
-----------------------------------------------
"The night sky over the planet Krikkit is the least interesting sight in the entire universe."
-Hitch Hiker's Guide To The Galaxy