Panel-Style Menu

A class that creates a menu from an XML file


Photo by: Adam

This is the class used in my personal site: http://www.north43design.com/adam/. It creates a menu with a background colour, image, and internal swf. See the XML below to see the format. Download class here

1. Constructor


new panelMenu([xml file to load]:String, [movieclip to load into]:MovieClip, [full window panel menu]:Booleen, [height]:Number, [width]:Number, [title font format]:TextFormat, [title hover font format]:TextFormat)

The class can be created through the following script:

var panelHolder = this.createEmptyMovieClip("panelHolder", this.getNextHighestDepth());
var txtFmt:TextFormat = new TextFormat();
txtFmt.color = 0xFFFFFF;
var txtFmt_hover:TextFormat = new TextFormat();
txtFmt_hover.color = 0x000000;

var panelMenu:panelMenu = new panelMenu("xml/menu.xml", panelHolder, false, 350, 500, txtFmt, txtFmt_hover);

2. XML Format


<content>Main XML node
<item>Each panel
<title>Here's a title</title>Title panel
<bgcolour>0xFF0000</bgcolour>Background colour of panel
<bgimage>images/image.jpg</bgimage>Background image of panel
<swf>swfs/flash.swf</swf>Swf for panel to load
</item>
</content>

3. Notes


When using a full screen version, height and width variables should still be entered in the constructor, although they have no impact on the functionality of the menu ie. new panelMenu("xml/menu.xml", panelHolder, true, 0, 999999999999, txtFmt, txtFmt_hover)



Posted by Adam on 25.02.2009.



Our Links

North43 Design
Our Latest
Client Login
Terms of Use

Categories

View All
News
Samples
Tutorials

Archive

This Month
Last Month
March 2009
February 2009
January 2009
CLIENT LOGIN | HOME | PROMOTIONS | PORTFOLIO | BLOG | CONTACT
info@north43design.com - All Content © 2008 North43 New Media Design