tshelto
01-24-2008, 03:55 PM
I guess I will ask the questions in here. lol
Okay on my stage I have a start(MC) and a stop(MC) and a clear(MC) these will be used as buttons. I also have a dynamic text box that shows my output.
I am making it so when you click start it will starting counting from 0 to whenever you hit the stop button, I have changed my fps to 1 so it doesn't crash my computer, And this is where I am running into trouble. Here is my code.
var myTimer = 0;
startBtn.onPress = function() {
this.onEnterFrame = function() {
myTimer = myTimer + 1;
//trace(myTimer);
this._parent.myTxt.text = myTimer;
}
}
stopBtn.onPress = function() {
trace(myTimer);
this.myTimer.onEnterFrame = stop();
}
I would also like it so when you hit start again it picks up where it left off.
Please any help would be greatly appreciated.
Thanks
T
Okay on my stage I have a start(MC) and a stop(MC) and a clear(MC) these will be used as buttons. I also have a dynamic text box that shows my output.
I am making it so when you click start it will starting counting from 0 to whenever you hit the stop button, I have changed my fps to 1 so it doesn't crash my computer, And this is where I am running into trouble. Here is my code.
var myTimer = 0;
startBtn.onPress = function() {
this.onEnterFrame = function() {
myTimer = myTimer + 1;
//trace(myTimer);
this._parent.myTxt.text = myTimer;
}
}
stopBtn.onPress = function() {
trace(myTimer);
this.myTimer.onEnterFrame = stop();
}
I would also like it so when you hit start again it picks up where it left off.
Please any help would be greatly appreciated.
Thanks
T