Gaia: Run pages standalone

Gaia Flash FrameworkI am a huge fan of Gaia Flash Framework, I use it for almost all my projects. It is a great framework if you want to create solid and maintainable Flash websites.

But as with many Frameworks it comes with some disadvantages; Gaia creates a .fla file for every page, but a page will not run standalone. After compiling the .fla file you have to test the page through the main.swf. For a huge project this is very unwieldy and inefficient.

So I created this “GaiaStandAloneRunner” which enables you to run your Gaia pages standalone, even with all the assets and SEO copy defined in your site.xml. The code only adds about 0.6 KB to your page swf file.

To get it working do the following:

  1. Add standalone.swf to your Gaia publish folder
  2. Add nl.tyz.gaia.GaiaStandAloneRunner.as
    and nl.tyz.gaia.IGaiaStandAlone.as to you classes directory
  3. Put the following code inside the constructor of your page:
1
new GaiaStandAloneRunner(this, 'xml/site.xml', Pages.HOME);

using to following arguments:

  1. reference to the Gaia page (will always be ‘this’)
  2. url to your site.xml
  3. Branche to the current page (see Pages.as)

That’s all.

Download an example, including source code

I did not test all types of assets, so please report me if you see any bugs.

6 Responses to “Gaia: Run pages standalone”

  1. Jonathan Says:

    I was able to publish the .fla without using main but I can’t preview the .swf without main. Did I do something wrong here? I just want to be able to take a page from an existing gaia framework and apply it to a new site that doesn’t use Gaia. Been bugging me for days.

    J

  2. Thijs Says:

    Jonathan: The GaiaStandaloneRunner only works if the page runs ’standalone’. If you load the page in an other SWF the GaiaStandaloneRunner won’t work.

  3. Jonathan Says:

    Ok. So that I understand…

    You are saying that there is NO WAY to take an existing page that was built as part of a Gaia framework, publish it, and load the SWF into another page?

    What if you place the actionscript in a keyframe in the .fla?

    I have a very important .fla that needs to be adjusted and republished but I am unable to recreate the Gaia framework in order to republish it. It seems that it would be possible to extract the actionscript for that page alone and bypass the Gaia framework. Do you have any suggestions as to how I can use this fla page in another website without the gaia framework.

  4. Thijs Says:

    Jonathan: I don’t say there is no way to take an existing Gaia page and load the SWF into another swf.
    But that is not where my GaiaStandAloneRunner is build for.

    But if the Gaia page can run into an other swf depends on how the page is depended on Gaia. But you could try to load the page into your swf and call ‘transitionIn()’ when the load is complete.

  5. Jonathan Says:

    Thanks so much. I was able to load and unload using transitionIn and Out. This entire time I have been trying to create a stand alone version of an SWF because I have a gaia framework project that is incomplete and can no longer be published entirely. There is no Pages.as or site.xml so I don’t know how to reference that particular page. I do have the actually document class actionscript file and I was going to attempt to make a standalone version but it doesn’t seem possible.

    Do you have any suggestions as to how I can republish the site given that I only have the .fla and .as…. I’m sure it would require more development, but it is imperative that I get this to work at some point tomorrow.

    Thank you so much for your responses. It is greatly appreciated.

    Jonathan

  6. Thijs Says:

    Jonathan: can’t you just make the site.xml yourself? It’s not that hard to create one. Just copy the default and adjust it.
    After you created the site.xml you can recreate the Page.as by scaffolding it with the Gaia panel.

Leave a Reply