|
DAVID reference
DAVID2 is a horizontal pop down menu component you can use for linking html sides or to use as navigation construct for your own functions.
to add a menu to your component use the following function: myComponent.addMenu(label:String, href:String, target:String)
label: the text appearing on the menu
href, target: an url to open a website, e.g. "http://www.frogstyle.ch/en/", "new"
to add a submenu use this function: myMenu.addSubMenu(label:String, href:String, target:String, icon:String, indented:Boolean)
icon: the linkage name of the movie clip symbol in the library to attach to a movie clip on the stage
indented: if set to true this puts a submenu in another subordinated position that is indented
important!
to assign a submenu to a specific menu you have to define your menu by a variable.
The submenu in this example has no url linking but a icon on it, that's why the 2nd and 3rd parameter are set to undefined.
var menu1:MovieClip = myComponent.addMenu("menuLabel");
menu1.addSubmenu("submenuLabel", undefined, undefined, "iconLabel");
properties panel
user defined functions
When you like to use DAVID component in other ways than linking to html sites you may set your own functions. First define your function:
var myObject:Object = new Object();
myObject.click = function() {
trace("write your executable code here");
}
then you can add the component structure:
var myMenu:MovieClip = myComponent.addMenu("Menu1");
var mySubMenu:MovieClip = myMenu.addSubMenu("SubMenu1", undefined, undefined, "iconLabel");
mySubMenu.addEventListener("click", myObject);
|

drag the DAVID component from the components panel (frog style components) (Ctrl-F7) to your stage. 
name the instance in the properties panel, e.g. myComponent 
create a new layer in your timeline and name it actions (that's not neccessary, but nice to do) 
select the first frame of layer actions. Press F9 to open the Actions window 
add a menu by typing 'myComponent.addMenu("1st Button", "http//www.frogstyle.ch/en/", "new"); 
repeat step 5 as you please 
use the component inspector (Alt-F7) to set different parameters
David Fürsinger is a Flash Programmer and is currently studying Biology at the ETH Zurich. david@frogstyle.ch
|