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

The main.asc File

The main.asc file is the heart of your application. You have used it already in previous chapters as a place for server-side ActionScript. Macromedia Flash Communication Server always looks for the main.asc file when it is loaded the first time. If the main.asc file is not available, Flash Communication Server looks for a file with the name of the application. For example, Communication Server would look for a file called myApp.asc within an application called myApp. main.asc is always loaded first, if it exists. All SSAS must stem from either of these files. The server looks first for main.asc, and then it looks for myApp.asc. If both files exist, main.asc takes priority, and myApp.asc is ignored. This does not mean that all SSAS must exist solely in the file. You can “include” external scripts inline. You saw this in earlier exercises when the components.asc file was loaded. This particular load reference includes the server-side counterparts for the Flash UI components that are nothing more than SSAS object classes.

The process of including scripts is handled by the load method. This method loads any ASC files relatively located to the main.asc or application-named file. Loaded scripts are inserted inline just like server-side includes, or a <CFINCLUDE> for those Macromedia ColdFusion buffs out there. They are compiled after being loaded with scripts inside the main.asc file. Their libraries are made available to the Application instances.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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