GhostWire Button - Actionscript API
Help/Reference Panel documentation for this flash component
is available with the installation of the component.
GWButton
Example
// Dynamically attach a GhostWire Button onto the stage during run time
_root.attachMovie("GWButton","myButton",1);
// Override the default properties by passing in the properties in an object
_root.attachMovie("GWButton","myButton",1,{
label:"Hello World!",
isEnabled:false});
GWButton.gethtmlLabel()
Parameters
None
Returns
A string specifying the label on the button, with any HTML tags included.
Description
Method; gets the label on the button with HTML included.
GWButton.getLabel()
Parameters
None
Returns
A string specifying the label on the button, with any HTML tags removed.
Description
Method; gets the label on the button.
GWButton.getSize()
Parameters
None
Returns
An object containing two properties -
width An integer specifying the width of the button, in pixels
height An integer specifying the height of the button, in pixels
Description
Method; gets the width and height of the button. The method returns an object containing the two properties width and height.
Example
// The following will get the width of the button
myButton.getSize().width;
// The following will get the height of the button
myButton.getSize().height;
GWButton.setColor(obj)
Parameters
obj An object containing the color properties of the button
Returns
Nothing.
Description
Method; sets the current color properties of the button. The five color properties in the object to pass are: face, highlight, highlight3D, shadow, darkshadow
GWButton.setDraggable(flag)
Parameters
flag Boolean value, specify whether button is draggable
Returns
Nothing.
Description
Method; sets the isDraggable property of the button. If set to true, the button can be dragged around when pressed down. If dragged instead of released, no onclick event is invoked.
GWButton.setEnabled(flag)
Parameters
flag Boolean value, specify whether button is enabled or disabled
Returns
Nothing.
Description
Method; sets the isEnabled property of the button.
GWButton.setLabel(label)
Parameters
label A string specifying the label to appear on the button
Returns
Nothing.
Description
Method; sets the label on the button. The label can be formatted with HTML.
GWButton.setLabelColor(color)
Parameters
color A number specifying the font color of the label
Returns
Nothing.
Description
Method; sets the font color of the label.
Example
// The following code sets the font color to #FFFFFF.
myButton.setLabelColor(0xFFFFFF);
GWButton.setLabelFormat(obj)
Parameters
obj A TextFormat object with the desired font properties
Returns
Nothing.
Description
Method; sets the font formatting of the label.
GWButton.setSize(width,height)
Parameters
width An integer specifying the width of the button, in pixels
height An integer specifying the height of the button, in pixels
Returns
Nothing.
Description
Method; sets the width and height of the button at runtime. Calling this method overrides any sizing applied during authoring. You should always use this method to resize the button during runtime, instead of directly setting the _width and _height properties.
Example
// The following code resizes myButton to 100 x 50 pixels at runtime.
myButton.setSize(100,50);
GWButton.onclick
Description
Event handler; invoked when the mouse button is pressed and then released from the button (single-click). You must define a function that executes when the event is invoked.
Example
// The following example defines a function for the onclick event
// that sends a trace action to the Output window.
myButton.onclick = function() {
trace ("single-click detected");
};
GWButton.onCtrlClick
Description
Event handler; invoked when the mouse button is pressed and then released from the button while the Ctrl key is pressed down (ctrl-click). You must define a function that executes when the event is invoked.
Example
// The following example defines a function for the onCtrlClick event
// that sends a trace action to the Output window.
myButton.onCtrlClick = function() {
trace ("ctrl-click detected");
};
GWButton.onCtrlDblClick
Description
Event handler; invoked when the mouse button is pressed and then released from the button twice in a row while the Ctrl key is pressed down (ctrl-double-click). You must define a function that executes when the event is invoked.
Example
// The following example defines a function for the onCtrlDblClick event
// that sends a trace action to the Output window.
myButton.onCtrlDblClick = function() {
trace ("ctrl-double-click detected");
};
GWButton.onDblClick
Description
Event handler; invoked when the mouse button is pressed and then released from the button twice in a row (double-click). You must define a function that executes when the event is invoked.
Example
// The following example defines a function for the onDblClick event
// that sends a trace action to the Output window.
myButton.onDblClick = function() {
trace ("double-click detected");
};
GWButton.onStartDrag
Description
Event handler; invoked when dragging of the component has started. You must define a function that executes when the event is invoked.
Example
// The following example defines a function for the onStartDrag event
// that makes the component's parent movieclip start dragging too.
myButton.onStartDrag = function() {
this._parent.startDrag();
};
GWButton.onStopDrag
Description
Event handler; invoked when dragging of the component has stopped. You must define a function that executes when the event is invoked.
Flash Components
Button
:: CheckBox
:: CollapsibleMenu
:: CollapsiblePane :: ColorPicker :: ComboBox
:: ContextMenu
:: DialogBox
:: InputField
:: ListBox :: Loader :: Menu
:: SlideMenu
:: NumericBox
:: Panel :: ProgressBar :: RadioButton
:: ScrollBar
:: ScrollPane
:: SlidePane
:: Slider
:: TabView
:: TextArea
:: TreeView
:: Window
See also
Documentation :: FAQs :: Testimonials
|