Actionscript 3.0 Xml driven menu.
We will build a menu witch is powered by an xml file; this offers a lot of flexibility because you can add/remove buttons by modifying the xml file and not by modifying the .fla file. The buttons will maintain they down state when clicked. We will not have any code on the timeline, all the code will reside in external classes, so it’s not only an xml driven menu it’s also coded in OOP style. We will use something called optional parameters ; they are parameters that have a default value. To better understand this, let look at a simple example. function sayMyName(name:String = "Sorin"):void { trace (name); } //We have a function with a parameter called name witch has a default value(Sorin), //if we call the function with no parameter passed to it the output will be Sorin sayMyName(); output: Sorin //if we call the function with a custom value("Elvis") the function will output Elvis sayMyName("Elvis"); output: Elvis Here is how the menu look...