July 2003
Intermediate to advanced
896 pages
45h 43m
English
The final step in creating a working scheduler application is to create the main code routine on the main timeline of the Flash document. Essentially, the main routine is responsible for three things:
Creating an instance of Macromedia’s Calendar component (the FCalendarSymbol must be available in the Library)
Creating an instance of the Schedule component
Creating functionality that opens a schedule item that corresponds to a calendar date when the calendar date is double-clicked
All you need to do to complete the scheduler application is add the following code to the first frame of the default layer of the Flash document’s main timeline:
// IncludeDrawingMethods.asfrom Chapter 4. #include "DrawingMethods.as" // IncludeMovieClip.asfrom Chapter 7 andTextField.asfrom Chapter 8. #include "MovieClip.as" #include "TextField.as" // IncludeDate.asfrom Chapter 10 andTables.asfrom Chapter 11. #include "Date.as" #include "Table.as" function init( ) { // Create an instance of the Calendar component. _root.attachMovie("FCalendarSymbol", "cal", _root.getNewDepth( )); cal.setChangeHandler("onSelectDate"); cal.setSize(Stage.width, Stage.height); // Create a Schedule component instance. _root.attachMovie("ScheduleSymbol", "scheduler", _root.getNewDepth( )); scheduler.setOnClose("onScheduleClose", _root); } // TheonSelectDate( )function is the callback function for the Calendar component. function onSelectDate(cmpt) { // Get the time, in milliseconds, since ...
Read now
Unlock full access