Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/09/2007, 10:04
omero
 
Fecha de Ingreso: junio-2002
Ubicación: En el trabajo...
Mensajes: 106
Antigüedad: 21 años, 9 meses
Puntos: 0
Exclamación Problemas con ClearInterval

Hola Tengo un problema con un count con lo que esel clearInterval

Pongo codigo (ejemplo) ademas pongo la liga para que la puedan ver.

http://www.iweb-lab.com/count/timer.swf

######################################

myTime.onLoad = function() {
myTime.setStyle("borderStyle", "default"); // set style for input box
}

countDown = function() { // esta parte la hace bien y si respeta el boton reset // define countDown function
hours = int(runTime / 3600); // calculate remaining hours
if (hours < 10) {hours = "0" + hours;} // -- adjust hours display
minutes = int((runTime / 60) - (hours * 60)); // calculate remaining minutes
if (minutes < 10) {minutes = "0" + minutes;}// -- adjust minutes display
seconds = int((runTime % 60)); // calculate remaining seconds
if (seconds < 10) {seconds = "0" + seconds;}// -- adjust seconds display
if (runTime <= 58) { // stop timer if zero
txtDone._visible = true; // show txtDone text
// timerMensaje = setInterval(countDown, 1000);
//xOut._visible = true; // show xOut graphic
// mySound.start(0,35); se quita el sonido // start sound object
timer.clearInterval;
timerhaciaArriba = setInterval(countUp, 1000);
timerhaciaArriba.clearInterval;
// timer = clearInterval(timer); // stop timer
} else {
runTime = runTime - 1; // decrement total seconds
// mandar al goto and play 2 donde debe de hacer lo contrario subir la numeracion
}
}

countUp = function() { // esta parte la hace bien sube la numeracion pero no respeta el boton reset // define countUp function
hours = int(runTime / 3600); // calculate remaining hours
if (hours < 10) {hours = "0" + hours;} // -- adjust hours display
minutes = int((runTime / 60) - (hours * 60)); // calculate remaining minutes
if (minutes < 10) {minutes = "0" + minutes;}// -- adjust minutes display
seconds = int((runTime % 60)); // calculate remaining seconds
if (seconds < 10) {seconds = "0" + seconds;}// -- adjust seconds display
if (runTime <= 3600) { // stop timer if zero
txtDone._visible = true; // show txtDone text
// runTime = runTime;
//timer.clearInterval(timer);
timer = clearInterval(timer);
runTime = runTime + 1; // Increment total seconds
timerhaciaArriba = clearInterval (timerhaciaArriba);
} else {
timer = clearInterval(timer);
runTime = runTime + 1; // decrement total seconds
timerhaciaArriba = clearInterval (timerhaciaArriba);
// mandar al goto and play 2 donde debe de hacer lo contrario subir la numeracion
}
}

btnStart.onRelease = function() {
if (myTime.text == "") { // check for blank input
myTime.setStyle("borderStyle", "alert"); // set alert borderStyle
} else {
runTime = Number(myTime.text) * 60; // calculate total seconds
myTime.setStyle("color", 0xCC0000); // set input box text color
myTime.editable = false; // disable input box
btnStart._visible = 0; // hide start button
timer = setInterval(countDown, 1000); // start timer
}
}
btnReset.onRelease = function() {
myTime.setStyle("borderStyle", "default"); // reset border style
btnStart._visible = 1; // unhide start button
myTime.text = ""; // reset input box
myTime.setStyle("color", 0x000000); // set input box text color
myTime.editable = true; // enable input box
hours = "00"; // reset countdown hours
minutes = "00"; // reset countdown minutes
seconds = "00"; // reset countdown seconds
txtDone._visible = false; // hide txtDone text
timerhaciaArriba = clearInterval(timerhaciaArriba);

timer = clearInterval(timer); // stop timer


}

###############################################

Este ejemplo llega a 58 de ahi empieza a acender la numeración pero al momento de darle clic en reset debe de parar ambos la duncion del countDown y la del countUp.

Que comando o que script debo de poner para que me respete el up en cero

alguien tiene idea de como poder poner en cero el count y que no siga avanzando el Countup ?

Gracias saludos