Using Global Variables to loop a movieclip

I could use some help. I have an animation on the main stage and I want it to play or loop using the time of the host computer, like when the time says two, it loops twice or play twice.Some one suggested i should use the date object to store the hours using global variables so i can use these global variables to loop the animation but i dont know how to declare global variables in that case store the hours.