Problem in digital clock

hi, i’ve got problem here… yesterday i’ve done a digital clock.its really cool.BUT, there’s a problem when i apply my digital clock in my flash website (fully in flash – not HTML, not PHP or etc.). when i click another page of the site, (only clocking when i open my flash site file) the clock was stop.why this happen and could someone help me to fix it up.

here my AS:


_root.onEnterFrame = function(){

var myDate:Date = new Date();
var myHours = myDate.getHours();
var myMinutes = myDate.getMinutes();
var mySeconds = myDate.getSeconds();
var AmPm;

if (myHours < 12){
    AmPm = "AM";
}
else
{
     AmPm = "PM";
}

if (myHours == 0) {
    myHours = 12;
}

if (myHours > 12) {
    myHours = myHours - 12;
}

if (myHours < 10) {
    myHours = "0" + myHours;
}

if (myMinutes < 10) {
    myMinutes = "0" + myMinutes;
}

if (mySeconds < 10) {
    mySeconds = "0" + mySeconds;
}

time_txt.text = myHours + ":" + myMinutes + ":" + mySeconds + " " + AmPm;

}