Help with setInterval(); or similar?

Hello,

I have used the moveTo & lineTo commands to create a simple line effect that appears during MovieClip.onRollOver. Can someone show me how to use setInterval() to allow this simple effect to first appear and then be cleared after 1 or 2 seconds (while in the onRollOver state)? Here is what I have so far:

myclip.onRollOver = overclip;

function overclip() {

_root.createEmptyMovieClip(“theline_mc”,1);
theline_mc.lineStyle(6,0xFFCCCC,85);
theline_mc.moveTo(52,-139);
theline_mc.lineTo(106,-195);
}

how do you set up the setInterval() timer for this?

Oh, and I am using Flash 8 to create this… Thanks!

well looks like you already got the rollover code so


function overclip() {

_root.createEmptyMovieClip("theline_mc",1);
theline_mc.lineStyle(6,0xFFCCCC,85);
theline_mc.moveTo(52,-139);
theline_mc.lineTo(106,-195);
if(!sett){
g = setInterval(remov,2000);
sett = true;
}
}
sett = false;
remov = function(){
sett = false;
clearInterval(g);
};

try something like that
(not tested)

Hi Joppe,

Your solution doesn’t seem to work. Any other suggestions?

Thanks

setInterval(the function you want to perform, for how many milliseconds)

If you want me to write you the code for you, then I’ll do it, but not now. But, after you have your loaded data set up, put the setInterval() function in.

Thanks for your help. I figured this one out