Forum Moderators: open
The scene has a clock on it ... set to 0:00 when the scene starts. The text states that the test takes two minutes, however, when the clock starts its count it only goes to the 1:00 minute mark. The question was to see how I can alter the below action script to make the counter count to 2 minutes instead of 1 minute.
The script:
onClipEvent (enterFrame) {
myCount = Number(_parent.count);
if (myCount<=9) {
_parent.myTime = String("00:0"+myCount);
} else if (myCount>=60) {
_parent.myTime = String("01:00");
} else {
_parent.myTime = String("00:"+myCount);
}
_parent.count = myCount+2;
}
Thanks for any help ...
-Scott
First it references a variable _parent.count and sets the MyCount variable to its value.
It then says if MyCount is less or equal to 9 then the instance of myTime on the parent timeline is set to 00.0 plus the variable myCount (presumably to compensate for loa times.
It then says if MyCount is greater or equal to 60 (one minute) set the instance of myTime to 01.00 in text form.
if however any other value applies set myTime to zero 00.0 as a text string.
It then adds 2 to the variable myCount until the above condition of reaching 60 is met
Theerfore:
onClipEvent (enterFrame) {
myCount = Number(_parent.count);
if (myCount<=9) {
_parent.myTime = String("00:0"+myCount);
} else if (myCount>=120) {
_parent.myTime = String("02:00");
} else {
_parent.myTime = String("00:"+myCount);
}
_parent.count = myCount+2;
Should just change everything to two minutes rather than one... hope that helps.
onClipEvent (enterFrame) {
myCount = Number(_parent.count);
if (myCount<=9) {
_parent.myTime = String("00:0"+myCount);
} else if ((myCount>=60) && (myCount<70)) {
myCount2 = (myCount - 60);
_parent.myTime = String("01:0" + myCount2);
} else if (myCount>=70) {
myCount2 = (myCount - 60);
_parent.myTime = String("01:" + myCount2);
} else if (myCount >=120){
_parent.myTime = String("02:00");
} else {
_parent.myTime = String("00:"+myCount);
}
_parent.count = myCount+2;
}
Hope you get the idea.. (i havent' not tried out using the Flash IDE. but from here you may start to dig it out urself).
Cheers :)