ActionScript 2.0 Components Language Reference |
|
|
|
| RadioButton component > RadioButton.label | |||
Flash Player 6 (6.0.79.0).
Flash MX 2004.
radioButtonInstance.label
Property; specifies the text label for the radio button. By default, the label appears to the right of the radio button. Calling this method overrides the label parameter specified during authoring. If the label text is too long to fit within the bounding box of the component, the text is clipped. You can call RadioButton.setSize() to increase the size of the label area, but text does not wrap to the next line.
To provide a label with text that wraps, you can combine a RadioButton with no label and a TextArea to act as a single RadioButton with wrapping text. The following example creates such a radio button. It assumes that you have a RadioButton component and a TextArea component in the library and turns off the border for the TextArea. The label property would be undefined in this case, if you accessed it.
this.createClassObject(mx.controls.RadioButton, "sameas_rb", 1, {groupName:"myGroup"});
sameas_rb.move(0,30)
this.createClassObject(mx.controls.TextArea, "message_ta", 2);
message_ta.setSize(200, 60);
// Turn off the border for the TextArea.
message_ta.borderStyle = "none";
message_ta.wordWrap = true;
message_ta.text = "Click here if your shipping information is the same as your billing information.";
message_ta.move(20, 30);
The following example creates a radio button and assigns it a label of "Remove from list."
You first add a RadioButton component from the Components panel to the current document's library, and then add the following code to Frame 1 of the main timeline.
/** Requires: - RadioButton component in library */ this.createClassObject(mx.controls.RadioButton, "my_rb", 10); // Resize RadioButton component. my_rb.setSize(200, my_rb.height); my_rb.label = "Remove from list";
|
|
|
|