A popular animation that anyone would come across several places, applications or even web pages would be a "Loading..." animation. Some would use progress indicator, and some goes on until it is complete. The type of animation getting used varies according to the requirement. This post discusses animating the Loading with three dots followed by it. There are other possible ways to create the same output other than the one explained here. The one presented here is the author's idea.
The intended animation starts with the text "Loading", then appears a dot, then the next and then the next [total of three], and all dots go off and starts from beginning. In the four states, the text is as follows
Just wanted the animation to start as the loading of the application completes and hence included applicationComplete="init()" as part of <s:Application> tag.
A bunch of operation like initializing few variables, timer, starting the timer etc has to be done in the init() function
i is the iteration variable [in other words, it denotes the current state of the animation], which here actually plays a vital role because based on the variable, the animation proceeds. Say i = 0 corresponds to the state 0 where only the text has to be displayed, i = 1, 2 ,3 adds respective amount of dots to the text and display it. Considering the above logic, the function is as follows
The four states are shown below from the output.