Wednesday, July 7, 2010

Flash 8 setTimeout Example


Originally blogged by Guy Watson, the setTimeout() function is an undocumented feature in Flash 8. This function can come in really handy for things like tooltips. See the sample app below where you can enter in any number for the delay. The actionscript is also posted below.
[as]tip._visible = false;
var isOn:Boolean = false;
butt.onRollOver = function() {
setTimeout(showTip,milli.text);
isOn = true;
}
butt.onRollOut = function() {
tip._visible = false;
isOn = false;
}
function showTip() {
if(isOn) {
tip._visible = true;
}
}[/as]

No comments:

Post a Comment