-
Book Overview & Buying
-
Table Of Contents
HTML5 for Flash Developers
By :
As with most languages, events are what really brings an application to life. Without the use of events, programs would usually just run from start to finish without the need for human interaction. JavaScript events are built around the asynchronous event model. Rather than checking continually to see if a condition is met, events can use call-back structures, like in ActionScript, to execute code once an event has been fired. A great example of this, which you may have already seen in many other examples thus far:
window.addEventListener("load", init, false);We use this Event Listener on the window object to allow our code to determine when the window object will finish loading, so that we can call our initial method to begin JavaScript manipulation of our document.
Mouse events are another one of the core elements almost all JavaScript projects contain. Although we will be using these events within the examples all throughout this book, it's worth...
Change the font size
Change margin width
Change background colour