addTool(label, icon, action, tooltip)
label: String, text that appears beside the icon (null or "" for no label)
icon: MovieClip that is used (make sure you export it for action script!)
action: if you provide a string, the function (on the same MovieClip as the toolbar) with this name is called. If you pass an object, function "onPress" of this object is called
tooltip: a little help text that appears when someone stays on a button (time can be set in the properties)
addTextfieldTool(label, width, action)
label: String, text that apperas initially in the text input
width: Number, size in pixel
action: Object, should have the function "onEnterKeyPress(str:String)" which is called when you hit enter while having the focus on the text field
addMenuTool(label, icon, submenu_items, action, tooltip)
label: String, text that appears beside the icon (null or "" for no label)
icon: MovieClip that is used (make sure you export it for action script!)
submenu_items: Array of Objects: {label: "String", icon: "String", data: "whatever you want to have returned"}
action: Object, function "onPress(data:Object)" is called when someone hits one of the tools. Top tool returns 0, sub-tools return according to the item (see "submenu_items")
tooltip: a little help text that appears when someone stays on a button (time can be set in the properties)
addSeparator()
adds a separator
disableToolAt(pos)
disables button at position pos + 1 (zero-based, first button is at position 0), do not confuse with tool_id (see note below)
enableToolAt(pos)
enables button at position pos + 1, do not confuse with tool_id (see note below)
removeAll()
removes all tools
setSize(width, height)
changes the width of the toolbar. You can omit height as this isn't implemented at the moment.
hideSubmenu()
hides the currently displayed submenu if any
addLabel(label, textcolor, width, align)
label: String, the text you want to display
textcolor: Number, a hex-number of the color, eg 0x77002 for our dark red
width: Number, labels have a static width (what makes it needless to redraw the toolbar every time you change the label)
align: String - "left", "right", "center"
addSliderTool(width, action, tooltip)
width: Number
action: Object, calls onSliderPress resp. onSliderRelease and returns the position (0 to 1) and the tool ID
tooltip: String, not yet implemented
setSliderToolPos(position, tool_id)
sets the position of a slider tool
position: Number between 0 and 1
tool_id: the ID of the slider tool (returned when you create any tool)
changeLabel(new_label, tool_id)
new_label: String
tool_id: the ID of the tool (returned when you create any tool) please do not try to change the label of label-less tools like the slider
IMPORTANT NOTE: addTool, addTextfieldTool, addMenuTool, addLabel and addSliderTool return an ID of the toolbar item. You may store this for changing the label or enabling the tool with
enableTool(tool_id) or disabling with
disableTool(tool_id). These new methods work with the internal tool_id which is returned when creating a tool