• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter I-3. Development > init() Function

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.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint