PDA

View Full Version : Monitor end of music to call get URL.



tommytx
July 4th, 2004, 01:21 AM
I need to write script to call another flash external movie with getURL at the instant the music stops. The initial flash program gives a show on stage with curtains opening and some acts on the stage, and after the show, the curtans close and the stage remains in tact with no futher action on screen until the end of the music. Howver the music continues about 45 seconds after all is done. I need to call another url as soon as the music is done. Is there a way I can begin to monitor the music to call get url when the music is done. This would then load another url.
I can't just time it, and load the next url in 45 seconds as some shows have music longer than others.
I hope there is a loop I can set up to keep checking the music status like we check the loading frame status to see when it is done.
Any ideas would be greatly appreciated.

Digitalosophy
July 4th, 2004, 03:03 AM
mySound.onSoundComplete = function(){
getURL("yourpage.html","_blank");
}


This is assuming your sound objects name is mySound

adamzfun
December 13th, 2007, 04:26 PM
This is the only way I got this to work:

my_sound = new Sound(this);
my_sound.attachSound("soundtrack");
my_sound.start(0,1);
my_sound.onSoundComplete = function()
{
getURL("main.htm", "_self");
}


This is a really great feature, however I only got it to work when I went to the Properties of the sound file I was using in Flash and set it to export the sound as well with the movie. This is strange to me because I would like to just be able to control the sounds in the actual FLA file. Oh well, I know very little about code and I finally got it to work. You can check it out at http://www.trulyyoursjewelry.com

The whole issue here is that no one talks about how to define the sound object.