Battletech Live

Online, Turn-Based Battletech – Development Logs

Actionscript 3, modules vs. sub-applications

I learned something new today. Last last week, I began making a few modifications to Battletech Live, trying to bring a few of the components into tighter integration. I moved a mini calendar from the left side menu into the drop-down menu used for Instant Messaging. I also moved the container for the helpdesk contact and for invitations into this panel. What this meant is that these three components were now part of an attached module instead of part of the main application. What I found is that if I loaded this newly modified module before loading the development panel that appears in the bottom center, the development module would fail to appear, but if I loaded the development module first, then the messenger module, the messenger module would die and start throwing errors.

I know that if you have two modules that have similar components, those components must be defined within the parent application, else one child will kill the other upon implementation, so I began going through my code to see if there was anything in either module that wasn’t present in the parent and I didn’t find anything. While looking at tutorials for the ModuleManager controller to check my code, I found information about sub-applications as opposed to modules. In an instance where a component is a display-only element, not needing to send information back to the parent, it can be configured as a stand-alone application, then tied into the parent application through the use of an SWFLoader. In my instance, the sub-application can still communicate back and forth with the server and as long as it doesn’t have need to affect elements of the main application, it works perfectly. These components are compiled separately from the main application and can be run on their own, which makes development faster and less dependent on the functionality of a single computer. An interesting added benefit is that I could also tie in swf files on other servers, and those written by other developers, which gives me the ability to coordinate with other people in order to add extra functionality to the project.

Now that this is sorted out, I can get back to developing new material instead of trying to fix the existing.

Advertisements

June 8, 2009 - Posted by | Project Development

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: