|
||
| Inside Technique : Time Master Timers are an essential for creating live and interactive web pages. In this article, we present a framework for easily creating and manipulating timers to choreograph sequences of events and for creating simple animation loops. What is web page animation? Web page animation includes anything that builds upon a set of timed events. When adding an animation, whether adding a clock, or moving an element around the screen, the underlying concept is almost always the same - a time period is specified, at which time a property on an object is updated. To demonstrate, below we create two variations of a clock. Both of these clocks are fundamentally the same. Every second, a property, whether it be the value of the text box or the status property on the window is updated. By the conclusion of this article, you will learn how to take advantage of timers and to use our framework to
create timed actions. For example, we created both clocks with a single function. By using our Timeline object, notice that
the script consists of more comments than code!
Before we go into the details about the Timeline object, we explain the need for timers, how to use them, and difficulties timers have with passing object-valued arguments. An object valued argument are necessary when you want to animate or write really reusuable code. In our clock example above, the current time can be assigned to any property of any object just by passing a different object and property to the updateTime function. Page 1:Time Master © 1997-2000 InsideDHTML.com, LLC. All rights reserved. |