MultiButton component

Availability

Flash Player 7

Description

Gives the designer the ability to create a multi selection toggle button with various styles and highlighting effects. You can group buttons together similar to radio buttons but with additional functionality. You can also load library symbols and even external .jpgs and .swfs to be displayed in your button. This would be a simple way to create an image thumbnailer.

Method summary for the MultiButton component

Method

Description

MultiButton.AddState()

adds a new state to the button with the parameters passed

MultiButton.ClearStates()

removes all states of the button clearing all labels, data, tooltips and icons

MultiButton.GetState()

returns an object for the current state of the button

MultiButton.SetFormat()

allows you to pass a TextFormat object to allow better manipulation of the font displayed on the button

MultiButton.SetState()

sets the button to a specific state, using this method will not fire an onchange event

Event summary for the MultiButton component

Event

Description

MultiButton.Click

invoked when the button is released after a ClickPress event

MultiButton.ClickPress

invoked when the mouse button is pressed while on the button

MultiButton.focusIn

invoked when the button receives focus

MultiButton.focusOut

invoked when the button looses focus

MultiButton.MouseOut

invoked when the mouse leaves the button

MultiButton.MouseOver

invoked when the mouse is placed over the button

MultiButton.StatusChange

invoked when the button is selected by either the user clicking on the button, or setting the State property or isSelected property via actionscript

Property summary for the MultiButton component

Property

Description

MultiButton.BackColor()

the default background coloration of the button

MultiButton.BorderColor2D()

specifies which color to use for the border when drawing a 2D button

MultiButton.BorderColorHighlight3D()

specifies which color to use for the highlight when drawing a 3D button

MultiButton.BorderColorShadow3D()

specifies which color to use for the shadow when drawing a 3D button

MultiButton.borderSize()

specifies the buttons drawable border in pixels

MultiButton.curveIndent()

specifys how many pixels should be indented when drawing a curve or the slant when drawing a slanted side

MultiButton.data()

allows you to quickly retrieve or set the data corrispoding to the current state of the button

MultiButton.Data()

array of data elements, each one corrisponding to a different state

MultiButton.DisableColor()

background color to use when the .enabled property is set to false

MultiButton.DisableFontColor()

font color to use when the .enabled property is set to false

MultiButton.effect()

specifies which effect to use when the mouse is placed over the button and removed from the button. this can be any one of the following:BUBBLES,FADEIN,GLOW,HIGHLIGHT,PULSE,SPACE,SLIDE DOWN,SLIDE LEFT,SLIDE RIGHT,SLIDE UP

MultiButton.EffectColor()

the coloration of the stars or bubles when using the .effect property is set to STARS or BUBBLES

MultiButton.font()

font face to use for the font on the button

MultiButton.fontBold()

if set to true the displayed font for the label will be bolded

MultiButton.fontColor()

font color to use on the button when it is in normal state

MultiButton.fontColorOver()

font color to use on the mouse is over the button

MultiButton.fontColorSelected()

font color to use when the button is a selected state

MultiButton.fontShadowColor()

font color to use for a behind font effect, useful for making the letters on the button appear as shadowed or knockout

MultiButton.fontShadowOffset()

a number which adjusts the x,y offset to place the font shadow behind the main font use a positive number for shadow and negative for knockout

MultiButton.fontSize()

font size to display on the button

MultiButton.fontWordWrap()

if set to true the text will wrap to multiple lines

MultiButton.groupName()

By specifying the same group name for multiple buttons, the button will act like a radio button group, when one is selected, the others will unselect. If the button has multiple states, the second state will always be initially selected and when toggled thru, the first state will never become active untill the button is no longer selected.

MultiButton.HighlightColor()

background color of the button when the mouse is over the button

MultiButton.ICON()

returns a reference to the currently loaded icon which will allow you to access properties and modify frame information you can also quickly change the icon by specifying a string value of a library linked id to load

MultiButton.Icons()

array of icons, each one corrisponding to a different state

MultiButton.iconSize()

the size to resize the icons to in pixels the resized icon will maintain its aspect ratio

MultiButton.iconX()

number of pixels from the left to place the icon at, a value of -1 will center the icon horizontally

MultiButton.iconY()

number of pixels from the top to place the icon at, a value of -1 will center the icon vertically

MultiButton.isSelected()

states if the button is currently selected

MultiButton.label()

allows you to quickly retrieve or set the displayed label for the current state

MultiButton.Labels()

array of labels, each one corrisponding to a different state

MultiButton.locked()

setting this property will allow the button to remain in the same physical state but will disable all mouse events to and from the button

MultiButton.LockRollH()

Setting this will cause the tooltip to keep this constant height, a value of 0 will make the tip expand and contract the height as needed

MultiButton.LockRollW()

Setting this will cause the tooltip to keep this constant width, a value of 0 will make the tip expand and contract the width as needed

MultiButton.LockRollX()

Setting this will cause the tooltip to keep position at this x location, a value of 0 will align to the x position of the mouse

MultiButton.LockRollY()

Setting this will cause the tooltip to keep position at this y location, a value of 0 will align to the y coordinate of the mouse

MultiButton.SelectedColor()

the background coloration of the button when the button .isSelected is true and .toggle is set to true or the button has a groupName

MultiButton.shapeleft()

specifies how to draw the left side of the button this can be any one of the following:LINE,CORNERCURVE,CURVELEFT,CURVERIGHT,SLANTLEFT,SLANTRIGHT you may also set the to a function, when doing so the button will call your function when it needs to draw the left or bottom shape of the button. The function will be passed the following ("b",dclip,xMin,yMin,xMax,yMax); "b" or "l" for bottom or left, When passed the "l" side the first call must be a dclip.moveTo(), dclip a reference to the canvas, xMin,xMax,yMin,yMax current dimmensions of the button.

MultiButton.shaperight()

specifies how to draw the right side of the button this can be any one of the following:LINE,CORNERCURVE,CURVELEFT,CURVERIGHT,SLANTLEFT,SLANTRIGHT you may also set the to a function, when doing so the button will call your function when it needs to draw the left or bottom shape of the button. The function will be passed the following ("b",dclip,xMin,yMin,xMax,yMax); "r" or "t" for right or top, dclip a reference to the canvas, xMin,xMax,yMin,yMax current dimmensions of the button.

MultiButton.ShineIntensity()

allows you to modify the appearence of the different themes the range is from -2.0 to +2.0

MultiButton.State()

the current state of the button 1 to the max number of labels,data, or icons specified

MultiButton.style()

specifies what type of button border to draw this can be any one of the following:2D,2D_INSERT,3D_SUNK,3D_RAISED,DISPLACED

MultiButton.textAlignment()

specifies if the text should be center, left, or right aligned on the button

MultiButton.textIndent()

specifies how many pixels the text should be indented before doing its alignment

MultiButton.theme()

specifies what type of button background to draw this can be any one of the following:SOLID,GEL,GLOSS,MARBLE,SHINE,GRADIENT if you specify something else the button will attempt to call a function by that name and pass it the following arguments (button,color,width,height button is a reference to the button, color specifies which color sould currently be used for the theme

MultiButton.toggle()

when set to true, a button can become selectable when the user clicks on it.

MultiButton.tooltip()

allows you to quickly retrieve or set the tooltip corrispoding to the current state of the button

MultiButton.ToolTips()

array of tool tips, each one corrisponding to a different state this can be regular or html formatted text

MultiButton.UseGlobalTheme()

if set to true the button will use the Macromedia global coloration styles

Author

Telsim, Inc.