Right now I have one .as file running my main MXML AIR Application. At first this was fine, but since the application is constantly growing, its getting harder and harder to keep the .as file orgainized so I can find things easily when they need to be fixed/changed or new things added to....
Is there any way to split up the .as file into multiple files and still have the AIR app work properly? I'd like to be able to split up the .as file into different files that pertain to different parts of the application so its easier to find things I need to get to.
How do you go about doing this? is there anything like an include statment like PHP has?
If this post answers your question or helps, please mark it as such.
You can break up the application into multiple .mxml and .as files.
Let's say you have a VBox that forms a major component in the application, just select File - New - MXML Component and create a component in an .mxml file with a root tag of VBox.
You can use this component in the main app using xmlns:local="*" if the component file is in the same directory of the main app, or xmlns:comp="myComponents.myContainers.*" if it is in a subdirectory myComponents/myContainers under the directory with the main app file.
Then in the body of the main app file have this:
You can also create ActionScript classes for components and use "import" to use the classes, or as you mentioned, you can just put variables and functions in an .as file outside any classes and use "include".
These links provide more info: