blob: 305560fec36eda20179e4ba94b6447630da92ed0 [file] [log] [blame]
{ "type": "class",
"qname": "mx.controls.Button",
"baseClassname": "mx.core.UIComponent"
,
"description": "The Button control is a commonly used rectangular button. Button controls look like they can be pressed. They can have a text label, an icon, or both on their face. <p>Buttons typically use event listeners to perform an action when the user selects the control. When a user clicks the mouse on a Button control, and the Button control is enabled, it dispatches a <code>click</code> event and a <code>buttonDown</code> event. A button always dispatches events such as the <code>mouseMove</code>, <code>mouseOver</code>, <code>mouseOut</code>, <code>rollOver</code>, <code>rollOut</code>, <code>mouseDown</code>, and <code>mouseUp</code> events whether enabled or disabled.</p> <p>You can customize the look of a Button control and change its functionality from a push button to a toggle button. You can change the button appearance by using a skin for each of the button's states.</p> <p>The label of a Button control uses a bold typeface. If you embed a font that you want to use for the label of the Button control, you must embed the bold typeface; for example:</p> <pre>\\n &lt;fx:style&gt;\\n &#64;font-face {\\n src:url(&quot;../MyFont-Bold.ttf&quot;);\\n fontFamily: myFont;\\n fontWeight: bold;\\n }\\n .myBoldStyle {\\n fontFamily: myFont;\\n fontWeight: bold;\\n }\\n &lt;/fx:style&gt;\\n ...\\n &lt;mx:Button ... styleName=&quot;myBoldStyle&quot;/&gt;\\n </pre> <p>The Button control has the following default characteristics:</p> <table class=&quot;innertable&quot;> <tr><th>Characteristic</th><th>Description</th></tr> <tr><td>Default size</td><td>A size large enough to hold the label text, and any icon</td></tr> <tr><td>Minimum size</td><td>0 pixels</td></tr> <tr><td>Maximum size</td><td>No limit</td></tr> </table> <p>The <code>&lt;mx:Button&gt;</code> tag inherits all the tag attributes of its superclass, and adds the following tag attributes:</p> <pre>\\n &lt;mx:Button\\n <b>Properties</b>\\n autoRepeat=&quot;false|true&quot;\\n emphasized=&quot;false|true&quot;\\n fontContext=&quot;<i>IFontModuleFactory</i>&quot;\\n label=&quot;&quot;\\n labelPlacement=&quot;right|left|bottom|top&quot;\\n selected=&quot;false|true&quot;\\n selectedField=&quot;null&quot;\\n stickyHighlighting=&quot;false|true&quot;\\n toggle=&quot;false|true&quot;\\n \\n <b>Styles</b>\\n borderColor=&quot;0xAAB3B3&quot;\\n color=&quot;0x0B333C&quot;\\n cornerRadius=&quot;4&quot;\\n disabledColor=&quot;0xAAB3B3&quot;\\n disabledIcon=&quot;null&quot;\\n disabledSkin=&quot;mx.skins.halo.ButtonSkin&quot;\\n downIcon=&quot;null&quot;\\n downSkin=&quot;mx.skins.halo.ButtonSkin&quot;\\n fillAlphas=&quot;[0.6, 0.4]&quot;\\n fillColors=&quot;[0xE6EEEE, 0xFFFFFF]&quot;\\n focusAlpha=&quot;0.5&quot;\\n focusRoundedCorners&quot;tl tr bl br&quot;\\n fontAntiAliasType=&quot;advanced&quot;\\n fontFamily=&quot;Verdana&quot;\\n fontGridFitType=&quot;pixel&quot;\\n fontSharpness=&quot;0&quot;\\n fontSize=&quot;10&quot;\\n fontStyle=&quot;normal|italic&quot;\\n fontThickness=&quot;0&quot;\\n fontWeight=&quot;bold|normal&quot;\\n highlightAlphas=&quot;[0.3, 0.0]&quot;\\n horizontalGap=&quot;2&quot;\\n icon=&quot;null&quot;\\n kerning=&quot;false|true&quot;\\n leading=&quot;2&quot;\\n letterSpacing=&quot;0&quot;\\n overIcon=&quot;null&quot;\\n overSkin=&quot;mx.skins.halo.ButtonSkin&quot;\\n paddingBottom=&quot;2&quot;\\n paddingLeft=&quot;0&quot;\\n paddingRight=&quot;0&quot;\\n paddingTop=&quot;2&quot;\\n repeatDelay=&quot;500&quot;\\n repeatInterval=&quot;35&quot;\\n selectedDisabledIcon=&quot;null&quot;\\n selectedDisabledSkin=&quot;mx.skins.halo.ButtonSkin&quot;\\n selectedDownIcon=&quot;null&quot;\\n selectedDownSkin=&quot;mx.skins.halo.ButtonSkin&quot;\\n selectedOverIcon=&quot;null&quot;\\n selectedOverSkin=&quot;mx.skins.halo.ButtonSkin&quot;\\n selectedUpIcon=&quot;null&quot;\\n selectedUpSkin=&quot;mx.skins.halo.ButtonSkin&quot;\\n skin=&quot;mx.skins.halo.ButtonSkin&quot;\\n textAlign=&quot;center|left|right&quot;\\n textDecoration=&quot;none|underline&quot;\\n textIndent=&quot;0&quot;\\n textRollOverColor=&quot;0x2B333C&quot;\\n textSelectedColor=&quot;0x000000&quot;\\n upIcon=&quot;null&quot;\\n upSkin=&quot;mx.skins.halo.ButtonSkin&quot;\\n verticalGap=&quot;2&quot;\\n \\n <b>Events</b>\\n buttonDown=&quot;<i>No default</i>&quot;\\n change=&quot;<i>No default</i>&quot;\\n dataChange=&quot;<i>No default</i>&quot;\\n /&gt;\\n </pre>",
"tags": [
{ "tagName": "includeExample",
"values": ["examples/ButtonExample.mxml"]},
{ "tagName": "mxml",
"values": []},
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"members": [
{ "type": "method",
"qname": "mx.controls.Button",
"namespace": "",
"bindable": [],
"details": [],
"deprecated": {},
"return": "",
"params": []}
,
{ "type": "accessor",
"access": "read-write",
"return": "String",
"qname": "locale",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {}},
{ "type": "accessor",
"access": "read-write",
"return": "String",
"qname": "textDecoration",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {}},
{ "type": "accessor",
"access": "read-write",
"return": "String",
"qname": "icon",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "The URL of an icon to use in the button",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "String",
"qname": "disabledIcon",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "The URL of an disabledIcon to use in the button",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "String",
"qname": "label",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "",
"tags": [
{ "tagName": "private",
"values": []} ]},
{ "type": "accessor",
"access": "read-write",
"return": "String",
"qname": "toolTip",
"namespace": "public",
"bindable": [],
"details": ["override"],
"deprecated": {}},
{ "type": "accessor",
"access": "read-write",
"return": "Object",
"qname": "data",
"namespace": "public",
"bindable": ["dataChange"],
"details": [],
"deprecated": {},
"description": "The <code>data</code> property lets you pass a value to the component when you use it as an item renderer or item editor. You typically use data binding to bind a field of the <code>data</code> property to a property of this component. <p>When you use the control as a drop-in item renderer or drop-in item editor, Flex automatically writes the current value of the item to the <code>selected</code> property of this control.</p> <p>You do not set this property in MXML.</p>",
"tags": [
{ "tagName": "default",
"values": ["null"]},
{ "tagName": "see",
"values": ["mx.core.IDataRenderer"]},
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "method",
"qname": "addBindingSupport",
"namespace": "protected",
"bindable": [],
"details": [],
"deprecated": {},
"description": "By default, ItemRendererDataBinding is added on-demand if an instance is used as a Drop-In Renderer But Button subclasses need to be able to add whatever binding support makes sense, and avoid the possibility of conflicting databinding support. Using this method in subclasses is one way to achieve that.",
"tags": [
{ "tagName": "param",
"values": ["bindingImplClass a class that is a subclass of DataBindingBase", "init true if the bindings should be initialized immediately"]} ],
"return": "void",
"params": [{ "name": "bindingImplClass", "type": "Class"},
{ "name": "init", "type": "Boolean"}]}
,
{ "type": "accessor",
"access": "read-write",
"return": "Object",
"qname": "listData",
"namespace": "public",
"bindable": ["dataChange"],
"details": [],
"deprecated": {},
"description": "When a component is used as a drop-in item renderer or drop-in item editor, Flex initializes the <code>listData</code> property of the component with the appropriate data from the list control. The component can then use the <code>listData</code> property to initialize the <code>data</code> property of the drop-in item renderer or drop-in item editor. <p>You do not set this property in MXML or ActionScript; Flex sets it when the component is used as a drop-in item renderer or drop-in item editor.</p>",
"tags": [
{ "tagName": "default",
"values": ["null"]},
{ "tagName": "see",
"values": ["mx.controls.listClasses.IDropInListItemRenderer"]},
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "Boolean",
"qname": "selected",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "",
"tags": [
{ "tagName": "private",
"values": []} ]},
{ "type": "accessor",
"access": "read-write",
"return": "String",
"qname": "labelPlacement",
"namespace": "public",
"bindable": ["labelPlacementChanged"],
"details": [],
"deprecated": {},
"description": "Orientation of the label in relation to a specified icon. Valid MXML values are <code>right</code>, <code>left</code>, <code>bottom</code>, and <code>top</code>. <p>In ActionScript, you can use the following constants to set this property: <code>ButtonLabelPlacement.RIGHT</code>, <code>ButtonLabelPlacement.LEFT</code>, <code>ButtonLabelPlacement.BOTTOM</code>, and <code>ButtonLabelPlacement.TOP</code>.</p>",
"tags": [
{ "tagName": "default",
"values": ["ButtonLabelPlacement.RIGHT"]},
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "Boolean",
"qname": "toggle",
"namespace": "public",
"bindable": ["toggleChanged"],
"details": [],
"deprecated": {},
"description": "Controls whether a Button is in a toggle state or not. If <code>true</code>, clicking the button toggles it between a selected and an unselected state. You can get or set this state programmatically by using the <code>selected</code> property. If <code>false</code>, the button does not stay pressed after the user releases it. In this case, its <code>selected</code> property is always <code>false</code>. Buttons like this are used for performing actions. When <code>toggle</code> is set to <code>false</code>, <code>selected</code> is forced to <code>false</code> because only toggle buttons can be selected.",
"tags": [
{ "tagName": "default",
"values": ["false"]},
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "method",
"qname": "createElement",
"namespace": "protected",
"bindable": [],
"details": ["override"],
"deprecated": {},
"description": "",
"tags": [
{ "tagName": "royaleignorecoercion",
"values": ["org.apache.royale.core.WrappedHTMLElement"]} ],
"return": "org.apache.royale.core.WrappedHTMLElement",
"params": []}
,
{ "type": "method",
"qname": "setInnerHTML",
"namespace": "protected",
"bindable": [],
"details": [],
"deprecated": {},
"description": "",
"tags": [
{ "tagName": "royaleignorecoercion",
"values": ["HTMLImageElement"]} ],
"return": "void",
"params": []}
]
,
"events": [
{ "qname": "click",
"type": "mx.events.MouseEvent"
,
"description": "Dispatched when the user clicks on a button.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "qname": "buttonDown",
"type": "mx.events.FlexEvent"
,
"description": "Dispatched when the user presses the Button control. If the <code>autoRepeat</code> property is <code>true</code>, this event is dispatched repeatedly as long as the button stays down.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "eventType",
"values": ["mx.events.FlexEvent.BUTTON_DOWN"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "qname": "change",
"type": "org.apache.royale.events.Event"
,
"description": "Dispatched when the <code>selected</code> property changes for a toggle Button control. A toggle Button control means that the <code>toggle</code> property is set to <code>true</code>. For the RadioButton controls, this event is dispatched when the <code>selected</code> property changes. For the CheckBox controls, this event is dispatched only when the user interacts with the control by using the mouse.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "eventType",
"values": ["flash.events.Event.CHANGE"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "qname": "dataChange",
"type": "mx.events.FlexEvent"
,
"description": "Dispatched when the <code>data</code> property changes. <p>When you use a component as an item renderer, the <code>data</code> property contains the data to display. You can listen for this event and update the component when the <code>data</code> property changes.</p>",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "eventType",
"values": ["mx.events.FlexEvent.DATA_CHANGE"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]}]
}