Gaia Framework: SWFAddress and MovieClip Assets

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;