init() Function


As with all other Flash applications my team creates, ActionScripting will mainly be done within methods. The exceptions are for simple statements such as #include or navigational statements such stop(). This formatting works well for our team because it makes it easier to track the flow of the ActionScript, since we're able to follow one function after another. It also allows us to split up most timelines into one layer containing functions and/or methods and another layer containing actions that call the functions and/or methods. For this application, when the jukebox is started, the init() method will be called. This method will include statements such as turning off the hand cursor, making global settings for components, setting the ticker, creating the Sound object, creating the SharedObject, and applying the saved settings to the jukebox.

Prototype useHandCursor

The first statement in the init() function turns off the use of hand cursors for all Button and MovieClip objects. Instead of the cursor changing to a hand when the mouse pointer moves over these objects, it will remain an arrow. We felt that this was OK from a usability perspective because the UI elements that can be pressed look like buttons.

 Button.prototype.useHandCursor=false;  MovieClip.prototype.useHandCursor=false; 

All objects in Flash have the prototype property. This property sets the default properties or methods for all instances of the object. In this case, we're saying to set the useHandCursor property to false for all Button and MovieClip objects.



Reality Macromedia ColdFusion MX. Macromedia Flash MX Integration
Reality Macromedia ColdFusion MX: Macromedia Flash MX Integration
ISBN: 0321125150
EAN: 2147483647
Year: 2002
Pages: 114

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net