# AS2 pathing

**URL:** <https://forum.kirupa.com/t/as2-pathing/313480>\
**Category:** Uncategorized\
**Created:** [August 31, 2010, 7:35pm UTC](https://forum.kirupa.com/t/as2-pathing/313480 "2010-08-31T19:35:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![red2034](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@red2034](https://forum.kirupa.com/u/red2034)\
**Post date:** [August 31, 2010, 7:35pm UTC](https://forum.kirupa.com/t/as2-pathing/313480/1 "2010-08-31T19:35:00Z")

</div>

I have found some code that uses \_root.

\*\*[COLOR=#ff0000]//\_root.createTextField(“timer”, \_root.getNextHighestDepth(), 5, 0, 100, 25);  
\_root.myMinutes = 10; //set to number of starting minutes  
\_root.mySeconds = 0; //set to number of starting seconds  
\_root.myMilliseconds = 0 //set to number of starting milliseconds  
\_root.timer.text = “000:00:” + twoDigitString(myMinutes) + “:” + twoDigitString(mySeconds) + “:” + myMilliseconds;

function updateTimer() {  
if(\_root.myMilliseconds == 0) {  
if(\_root.mySeconds == 0) {  
if(\_root.myMinutes == 0) {  
\_root.timer.text = “Please continue!”;  
clearInterval(myInterval);  
delete myInterval;  
}  
else {  
\_root.myMinutes = \_root.myMinutes - 1;  
\_root.mySeconds = 59;  
\_root.timer.text = “000:00:” + twoDigitString(myMinutes) + “:” + twoDigitString(mySeconds) + “:” + myMilliseconds;

}  
}  
else {  
\_root.mySeconds = \_root.mySeconds - 1;  
\_root.myMilliseconds = 400;  
\_root.timer.text = “000:00:” + twoDigitString(myMinutes) + “:” + twoDigitString(mySeconds) + “:” + myMilliseconds;

}  
}  
else {  
\_root.myMilliseconds = \_root.myMilliseconds - 1;  
\_root.timer.text = “000:00:” + twoDigitString(myMinutes) + “:” + twoDigitString(mySeconds) + “:” + myMilliseconds;

}  
}

// This function will make sure we have two number places in our number if it’s less then 9(0#)

function twoDigitString(myNumber) {  
myTemp = String(myNumber);  
if(myTemp.length == 1) {  
myTemp = “0” + myTemp;  
}  
return myTemp;  
}

myInterval = setInterval(updateTimer, 1);  
stop();

[/COLOR]\*\*but I am using the swf in a container so the \_root. breaks this [[COLOR=blue][COLOR=blue !important][FONT=verdana][COLOR=blue !important][FONT=verdana]Im[/FONT][/COLOR][/FONT][/COLOR][/COLOR]](http://board.flashkit.com/board/showthread.php?p=4263578#) sure…  
I have tried changing all the \_root. to this. with no luck it doesnt work at all?!?!?!

Please help

Red
