Delay function

hello…
i’m made a delay function. The problem is that it does not work…


delay = function(s,fps) {
	tt=new Number(); tr=new Boolean();
	_root.onEnterFrame=function() {
		tt++;
		if (tt==s*fps) {
			tr=true;
		} else {
			tr=false;
		}
	}
	return tr;
}

i want the function to return true when s seconds have passed on a fps fps movieclip and false after and before. why doesn’t it work??

stick in some trace AS…
ie. trace(s)
coz it doesnt look like youve defined “s”… but using trace function (or dynamic text boxes to display variables and/or properties) helps ME alot in debugging…

Prophet.

i tried and everything works…s is shown…and the function works if i use it on onenterframe. It does not workm on onLOAD… why??