Global navigation for Flash and Gaia Flash Framework
February 25, 2009 by: ChristianIntroduction
My own AS2 website framework was almost finished when AS3 came out. I knew some day I would have to port it from AS2 to AS3. At the same time I planned to do it a lot better, because on the long way of programming my AS2 framework I had been learning a lot about OOP and I wanted to do it much better in the next version. But I came to realize that it would take a very long time to do it the way I wanted it, so instead of reinventing the wheel I started to search for a solution. After some time I came across the Gaia Flash Framework of Steven Sacks and after a while studying it, it hit me like a thunderstroke. I realized it was all there: the handling of loading/unloading content pages, the implementation of swfobject and swfaddress, a xml setup file for the site structure. And, most important: It it a framework others are using as well, so all of a sudden the times of having an individual framework for almost each website was gone. From now on it was easy to work together with other flash designers/coders on the same project. It was just perfect. There was only something missing I had in my AS2 framework: A global navigation system! But, as I had much time left because I didn’t have to port my framework to AS3, I put some extra time into developing a global navigation that can be used either stand alone or seemlessly integrated into Gaia.
How does it work?
The global navigation consists of 3 parts: a SWF of a single button with rollover, rollout, press etc. states and a text label, an XML file containing the structure and a class (in fact there are 3 main classes, but you don’t need to worry about them), which mixes everything together and spits out a neat navigation.

See samples and download source code here.
.






when I published it using flash cs3, it wont work, it said that there is a problem in actionscript file. is global navigation needs some class which can make it work properly?
Hi Tod
I need some more info… Have you just downloaded it and then compiled it in CS3?
Is there a was to not have the previous page in the hierarchy show underneath when clicking on a sub menu item. For instance in the image above, if you click button-1 then button1-1 you will see the assets for both button-1 and button1-1. I’d rather it be that you only see the assets for button1-1 (the section you are clicking on. Is there an easy way to adjust it to do this? Thanks for any help on this.
Hi Jordan
Have a look at this: http://www.flashcmsframework.com/docs/doku.php?id=global-navigation2-public-methods#getsiblings
When you click a submenu, you can receive the siblings of the parent buttons to do what you want. For example cycle through the buttons of a level to hide them.
i want to ask, if there is a solution that you could have multiple button “styles”?
i mean, the submenu button looks different to the main menu etc.
kind regards
matthias
Hi Matthias
In the navig.xml file you assign a SWF on a per button basis. Check the examples and the docs.
That is no problem at all. You can have a different style for every single button.
Hi Christian,
In your “See life demo”, How do you get the rollover effects? The gradual glow? I can only seem to have my effect turn on and off even if I set up a movieclip with a tween. I can’t figure out where/what to put in the NavPage.as to achieve this effect.
Thanks,
Amy
Hi Amy
The animation of a single button can also be done in the button swf itself. Have a look inside mainBtn.fla.
Cheers,
Christian