To Gaia or not to Gaia

For the past 3 years at least, I’ve been designing and developing websites for a variety of clients. I’ve built portfolio websites for photographers, art dealers and other designers I’ve created e-commerce websites in Flash and built PHP and Flash CMSs for most of them to allow the website to be updated easily. I’ve created complex websites that involve a lot of planning and Math or hours and hours of tweaking animations as well as simple websites which only appear to have 1 or 2 pages and very understated animation.

gaia

 

About 6 months ago I finally got a chance to play with Gaia, so I re-built my portfolio website using the framework first of all. It took about 16 attempts until I finally got the site working, but by then I had mastered the Gaia art and the following website I built took 2 days from start to finish! From that point I started using Gaia for every job I got as it made the initial site planning that much simpler and scaleable. However I then started getting frustrated. Recently I’ve built nothing but portfolio websites, these need to load super fast and get the work in front of the visitor as soon as possible in the most interesting but none obtrusive way possible. After building a couple of these sites in Gaia I decided that this isn’t the right tool for the job.

Gaia splits a website up in to pages and creates a seperate fla file for each, it then sensibly loads the various pages and handles the transitions between one page and another. This is fantastic for a website which is graphics heavy or has kick-ass animations to transition between pages but I just want to swap from one gallery to another or open a new folio and I’m having to sit through preloaders and non-existent transitions. Don’t take this the wrong way, Gaia is awesome and I will be using it as much as possible in the future, but I will make sure that the project is suited and ‘needs’ Gaia to make life easier.

The things I found I wanted to achieve for these website were:

  • Once a page has been loaded, I shouldn’t have to preload it again if I return to that page
  • The websites don’t need to be split across multiple fla files, they could be classes or library instances in 1 fla

There are probably a few more goals I wanted for my portfolio website but these two sum up my decision to move away from Gaia. For the past few months I’ve started building a simple set of classes that I can use to handle this very issue. It’s nowhere near as robust as Gaia at the moment or has nowhere near the same features, in fact the entire class consists of a Constructor and 3 public methods, addPage(), setSize() and goto(). Basically, I create however many pages the website will have (generally 2 – 4) and each page must subclass AbstractPage, then I create an instance of my PageManager class and use addPage() to create a new instance of that page inside the manager along with an id so I can reference it later. By calling goto() and passing an id I tell the PageManager which page I want to load and it calls the hide() method on the currently active page and then show() on the new page() which are both handled in the AbstractPage class and can be overridden to provide more interesting transitions.

I also use setSize() so that I don’t have to set up new event listeners in each page to listen for a stage resize event. setSize() simply calls setSize() on the active page only, this also stops all the pages running calculations when the website resizes.

To conclude, Gaia is a fantastic framework, providing you are building a website which can be graphic heavy and needs a robust framework to build upon. If you are building simple portfolio websites or websites which load all their content externally and don’t use complicated transition, use SWFAddress and build the site as a single file.