| Flashscript classes (ActionScript 3) | Home | MX | MX 2004 | Flash 8 | Flash 9 |Flash 10 |PHP |Components | Snippets | Contact | |
CustomRadioButton |
|
|
| Property | Defined By |
|---|---|
|
label
: String
Defines the label for the component. |
CustomRadioButton |
|
rGroupName
: String
Defines the group name for the component. |
CustomRadioButton |
|
bLength
: int
Defines the length of the component instance. |
CustomRadioButton |
| Method | Defined By |
|---|---|
| All inherited methods for the MovieClip class. | N/A |
| Event | Defined By |
|---|---|
|
clicked This event is dispatched when the component instance is pressed. |
CustomRadioButton |
| All inherited events for the MovieClip class. | N/A |
| Property Detail |
|---|
|
label property label:String [read-write] This defines the label for the component instance. Implementationpublic function get label():Stringpublic function set label(value:String):void |
|
rGroupName property rGroupName:String [read-write] This defines the group name for the component instance. In case of multiple instances only the one selected will show the selected icon. Implementationpublic function get rGroupName():Stringpublic function set rGroupName(value:String):void |
|
bLength property bLength:int [read-write] This defines the length for the component instance. Implementationpublic function get bLength():intpublic function set bLength(value:int):void |
| Constructor Detail |
|---|
|
CustomRadioButton () Constructor
public function CustomRadioButton() |
| To initialize an instance use new CustomRadioButton(). |
| Event Detail |
|---|
|
clicked event
Event Object Type:
biz.flashscript.components.buttons
Dispatched when the component instance is selected. |
| Examples |
|---|
Create a new fla file and name it CustomRadioButtonExample.fla. Save the file in the same folder where the biz folder is located. Drag two instances of the CustomRadioButton component on stage from the component menu and name them but1 and but2. Then create an Actionscript file, name it CustomRadioButtonExample.as and place this script.
package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import biz.flashscript.components.buttons.CustomRadioButton;
public class CustomRadioButtonExample extends Sprite
{
private var but1:CustomRadioButton;
private var but2:CustomRadioButton;
public function CustomRadioButtonExample ():void
{
but1=new CustomRadioButton();
but1.addEventListener ("clicked",cHandler);
but1.label = "item 1";
but1.rGroupName = "shop";
but1.x = 10;
but1.y = 10;
addChild (but1);
but2=new CustomRadioButton();
but2.addEventListener ("clicked",cHandler);
but2.label = "item 2";
but2.rGroupName = "shop";
but2.x = 10;
but2.y = 40;
addChild (but2);
}
function cHandler (e:Event):void
{
trace (e.currentTarget.label);
}
}
}
|