Hi, I have the code below to control a movieclip that will move in one direction when the user rolls over it, and will move back when the user rolls out of the mc.
I created two functions to give a delay in the movement, but when I move the cursor on rollover and rollout fast and repeated, the movie goes out of control and start moving back and forward.
Here is a FLA of what I am trying to do.
http://www.dyangochavez.com/offline/test2.fla
Can anyone give me any suggestions on how to solve this?
Thanks a lot
**
**import mx.transitions.Tween;
import mx.transitions.easing.*;
var infoInt;
var infoInt2;
var count = 0;
var count2=0;
function showInfo () {
if (count == 5) {
clearInterval (infoInt);
clearInterval (infoInt2);
count = 0;
var infoT:Tween = new Tween (info_mc, "_y", Strong.easeOut, 285, 66, 2, true);
} else {
count++;
}
}
//
function hideInfo () {
if (count2== 5) {
clearInterval (infoInt);
clearInterval (infoInt2);
count2= 0;
var infoTback:Tween = new Tween (info_mc, "_y", Strong.easeOut, 66, 285, 2, true);
} else {
count2++;
}
}
//
info_mc.onRollOver = function () {
infoInt = setInterval (showInfo, 100);
};
info_mc.onRollOut = function () {
infoInt2 = setInterval (hideInfo, 100);
};