Gaia Framework: How to work with SWFAddress and SWF Assets from Nicole Chung on Vimeo.
Here are some code snippets I found useful when working with SWFAddress in the Gaia Framework, if anyone has more suggestions let me know!
To change the address:
Gaia.api.goto("index/nav/my-current-page/my-sub-page");
Gaia automatically listens for when the address changes, but if you are doing something special when the address changes (other than loading in a page) you can override the onDeeplink method:
overrride public function onDeeplink(e:GaiaSWFAddressEvent):void
{
trace(e.deeplink);// gets you the deeplink
// do your stuff here
}
When working with .swf assets, there’s no need to manually load the asset in (unless you want to), just include the following in your site.xml:
<asset id="yellow_mc" src="yellow.swf"/>
Then to make your .swf file visible, write:
IMovieClip(assets.yellow_mc).visible = true;
And to access items on the stage of your yellow_mc:
IMovieClip(assets.yellow_mc).content.instanceName = doSomething;
So today I started messing around with the Hype Framework. I’m going to upload a screencast soon on how to set up the Hype Framework with the Gaia Framework.
Gaia Flash Framework – How to use your own preloader animation from Nicole Chung on Vimeo.
Lately I have been messing around with the Gaia Framework. I think for certain kinds of flash sites – for example, sites that aren’t Flash games or complex applications – that this framework is a great thing. I know that there are developers out there who feel that it’s better to roll their own framework, but Gaia really does a lot, especially if you use SWFAddress (which – once you get into making larger sites with more than one “/level/” of linking – isn’t easy without employing some design patterns).
A really great thing about the framework, in addition it the constant updates (which I suppose if you were on a longer project, might end up working against you) are some terrific mods (for example, to control cacheing and memory management) and a pretty easy-to-use API.
Using the Gaia Framework, it’s possible to use timeline-based transitions that are controlled by Actionscript using Frame Labels and Frame Scripts.
Even though there is an option to choose “Timeline” transitions, just use the “Actionscript” option instead
When you create your timeline transitions, add frame labels to your timeline at the start and beginning of each transition. Then, when the end of the timeline transition occurs, write a frame script that dispatches an event notifying the project that the end of the transition was reached
.
So today I am starting to build a small site using the Gaia Framework.
The first thing I noticed is that when creating assets, the asset ID has to be alpha-numeric, so the following:
- won’t work at all. It has to be:
No dashes.
No ending with a number.