Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Playing a Sound at Specified Time Intervals 1

Status
Not open for further replies.

ccie9545

Instructor
Aug 28, 2002
134
US
Help...

I need to play a sound at specified time intervals. Specifically I would like to create a tick-tock sound every second. I just can't seem to figure out how to do this. Below is the actionscript I have created so far. You will probably laugh when you read it, but, this is actually the first time I have tried it.....so don't laugh too hard...

icncDate = new Date()
seconds = icncDate.getSeconds()
minutes = icncDate.getMinutes()
hours = icncDate.getHours()
if (seconds<10) {
seconds = &quot;0&quot; + seconds
};
if (minutes<10) {
minutes = &quot;0&quot; + minutes
};
icncTimeTextField = (hours + &quot;:&quot; + minutes + &quot;:&quot; + seconds);
tick = new Sound ();
tick.attachSound(tick);

Not sure what to do now...Thanks in advance....
erik Erik Rudnick, CCIE No. 9545
mailto:erik@kuriosity.com
 
If you're using MX then the setInterval action will give you what you want.

setInterval(function, interval);

Set up the sound event within a function -

function playTick(){
tick.start();
}

then call it from here:

setInterval (playTick,1000);


 
thanks..... Erik Rudnick, CCIE No. 9545
mailto:erik@kuriosity.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top