Battletech Live

Online, Turn-Based Battletech – Development Logs

Looking for ways to speed up Flash.

On my nootebook, a 2.4GHz Core 2 Duo, loading Battletech Live is pretty quick, but on my Ubuntu machine, a 2.2GHz single-core system, it can take a bit of time depending on whatever else I’m doing.  I’m looking for ways to reduce the overhead and make things load quicker.  Everything I have so far is called into existence when the page loads with some parts of the site simply hidden behind viewports.  Server calls take place according to what state the site is in.  So, the idea will be to take things a step further and create some components programatically instead of coding them at design time.  Hopefully, this will speed things up as there will be less controls constructed at a given time.  If done right, and while eliminating references across components, panels can be created when the user clicks on an activator, then slid into position and destroyed when a user moves on to another area.  Considering the current interface is less than 10% complete, this is a very important thing.

February 12, 2009 - Posted by | Project Development


  1. It’s standard practice to break a large flash site into separate swfs that are loaded/unloaded as needed. This drops initial load time and allows/forces you to keep work compartmentalized. It can also help in “streaming” important pieces in the background while the user is doing other tasks.

    Comment by Ian Bellomy | March 26, 2009

  2. Agreed. I began reading into some information found on talking about using includeInLayout along with visible=false, but have found the method to have very little impact on performance. I have found that my development speed is much improved since dividing my code out into multiple actionscript files, such as all scripts relating to email, all calendar scripts, all mechBay scripts and so on. I also moved the majority of my variables to their own file named gridSources. It makes things much easier to read and easier to reference, not having to scroll all over creation to find what I’m looking for. However, none of this has had any effect on the speed of the resultant website. I would find it very handy to be able to divide the site into multiple SWF files, accessed accordingly although so little of the project is finished, it’s sometimes difficult to decide where things most logically fit.

    It took me most of a day to get one of my components turned into a modular swf, but this is exactly what I’ve been looking for how to do. It makes it easier to code a given section because there is no need to switch back and forth between states to see what’s going on. Converting existing sections of code, does take quite a bit of time.

    Comment by Charles Shoults | March 26, 2009

  3. Just to make sure, I get a small inkling that you’re using AS 2 or maybe even 1. Even using AS 2 and a class based approach would _require_ you to use separate as files from the start. If you _are_ using AS 1 or 2 you’re going to run into performance limits much much sooner than if you were using AS 3.

    Comment by Ian Bellomy | March 28, 2009

  4. Flex Builder 3. I am using mxml as a base file with actionscript 3. So far, I’m up to a few dozen .as files, plus those that have come from other packages such as alternativa. The split so far is one primary swf, with three modules.

    Comment by Charles Shoults | March 28, 2009

Leave a Reply

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

You are commenting using your 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: