Forum Moderators: open
The counter is dynamic text (Var: longitude). Here is the code I have so far. The rollOver/countdown sequence seems to work perfectly, but the releaseOutside, rollOut / count upwards part is buggy and seems to put the counter in an infinite loop between 117 and 118...
I would immensely appreciate feedback on how to make this script work, and any tips you have to code this better. Thanks!
onClipEvent (load) {
_parent.longitude = 119;
}
on (rollOver) {
CountLong = function (reel) {
if (_parent.longitude>117) {
--_parent.longitude;
}
};
setInterval(CountLong, 700, "reel");
}
on (releaseOutside, rollOut) {
CountLong = function (reel) {
if (_parent.longitude<119) {
++_parent.longitude;
}
};
setInterval(CountLong, 700, "reel");
}
onClipEvent (load) {
_parent.longRight = 119;
}
on (rollOver) {
clearInterval(rLongScroll);
var rLongScroll = setInterval(Reel, 500);
function Reel() {
if (_parent.longRight>117) {
_parent.longRight--;
}
}
}
on (releaseOutside, rollOut) {
clearInterval(rLongScroll);
var rlongScroll = setInterval(Reel, 500);
function Reel() {
if (_parent.longRight<119) {
_parent.longRight++;
}
}
}