Plugging in External Classes to Gaia Framework Files

Posted: June 19th, 2009 | Author: Liza | Filed under: As3, Flash, gaia framework | Tags: , | No Comments »

I probably go on about Gaia Flash Framework, its mainly because that’s what I used to learn AS3 and I’m still figuring it out.

One of the main problems I have with it is plugging in external classes to the Gaia packages.

These are the basic steps to adding an external class, ill be updating this if I find any more issues.

1. Import the class to the main package import area.
2. Create individual private variables for any of the class instances or movie clips.
3. Instantiate the object in the constructor
4. Add the function to the list.

Also don’t forget to add any movie clips (and instances) onto the stage and create linkages in the library if necessary.

If you get a 1009 error its probably because you havnt published the project.


Accessing the stage in Gaia Framework

Posted: June 14th, 2009 | Author: Liza | Filed under: As3, Flash, Uncategorized, cs3, cs4 | Tags: , , , | 1 Comment »

I have had alot of trouble trying to access the stage from Gaia Framework, but thanks to David, I’m finally getting the hang of it.

I needed to access the stage width (when resized) to create a a bar to sit behind the navigation on my site.

First I had to add this to the class constructor:

addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);

Then create the following 2 functions:

private function onAddedToStage(event:Event):void
{
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
stage.addEventListener(Event.RESIZE, onResize);
onResize();
}

private function onResize(event:Event = null):void
{
navBackBar.width = stage.stageWidth;
navBackBar.x = 0 - ((stage.stageWidth - Gaia.api.getWidth()) / 2);
}

navBackBar is the name of the movieclip on the stage.  You can see it behind the navigation on my site.


5000: Error migrating from CS3 to CS4

Posted: June 14th, 2009 | Author: Liza | Filed under: As3, Flash, cs3, cs4 | Tags: , , , , , | No Comments »

I have moved more than 1 Gaia Framework file from Flash CS3 to CS4 and got this error.

5000: The class ‘Work’ must subclass ‘flash.display.MovieClip’ since it is linked to a library symbol of that type.

The solution is to import the MovieClip class into the import area and to extend the main class as a MovieClip.

In my case from this:

public class Logger
{

to this:

public class Logger extends MovieClip
{