PDA

View Full Version : delaying button activation


uvabritt
02-13-2007, 03:58 PM
I want a button to appear dimmed until a certain amount of time has passed. How do I delay the button appearing fully opaque until I want it to? I basically need to know how to delay an action.

like:

if [less this amount of time has passed] {
button._alpha = 50
}

else {
button._alpha = 100
}

sorry if this has been covered elsewhere! thanks for any help!

Noct
02-13-2007, 05:10 PM
button._alpha = 50;
//declare variable to hold interval
//(insert function to run, and time limit (ms*1000=1 second))
var myInt = setInterval( waitOneSecond, 1000 );

function waitOneSecond() {
button._alpha = 100;
trace("Function Executed");
//Clear interval so it wont run every second, just once.
clearInterval(myInt);
}