Package | fl.data |
Class | public dynamic class SimpleCollectionItem |
Inheritance | SimpleCollectionItem ![]() |
Language Version : | ActionScript 3.0 |
Player Version : | Flash Player 9.0.28.0 |
label
and
data
properties--for example, a ComboBox or List component.
Property | Defined By | ||
---|---|---|---|
![]() | constructor : Object
A reference to the class object or constructor function for a given object instance.
| Object | |
data : String
The data property of the object.
| SimpleCollectionItem | ||
label : String
The label property of the object.
| SimpleCollectionItem | ||
![]() | prototype : Object
[static]
A reference to the prototype object of a class or function object.
| Object |
Method | Defined By | ||
---|---|---|---|
Creates a new SimpleCollectionItem object.
| SimpleCollectionItem | ||
![]() |
Indicates whether an object has a specified property defined.
| Object | |
![]() |
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter.
| Object | |
![]() |
Indicates whether the specified property exists and is enumerable.
| Object | |
![]() |
Sets the availability of a dynamic property for loop operations.
| Object | |
![]() |
Returns the string representation of the specified object.
| Object | |
![]() |
Returns the primitive value of the specified object.
| Object |
data | property |
public var data:String
Language Version : | ActionScript 3.0 |
Player Version : | Flash Player 9.0.28.0 |
The data
property of the object.
The default value is null
.
label | property |
public var label:String
Language Version : | ActionScript 3.0 |
Player Version : | Flash Player 9.0.28.0 |
The label
property of the object.
The default value is label(n)
, where n is the ordinal index.
SimpleCollectionItem | () | Constructor |
public function SimpleCollectionItem()
Language Version : | ActionScript 3.0 |
Player Version : | Flash Player 9.0.28.0 |
Creates a new SimpleCollectionItem object.
To run the example, follow these steps:
package { import fl.controls.ComboBox; import fl.controls.Label; import fl.data.*; import fl.data.SimpleCollectionItem; import flash.display.Sprite; import flash.events.Event; import flash.text.TextFieldAutoSize; public class SimpleCollectionItemExample extends Sprite { private var dp:DataProvider; private var cb:ComboBox; private var myLabel:Label; public function SimpleCollectionItemExample() { dp = new DataProvider(); var i:uint; for(i=0; i<42; i++) { var sci:SimpleCollectionItem = new SimpleCollectionItem(); sci.label = "Item "+i; sci.data = null; dp.addItem( sci ); } cb = new ComboBox(); cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, announceSelectedItem); cb.move(10,40); addChild(cb); myLabel= new Label(); myLabel.autoSize = TextFieldAutoSize.LEFT; myLabel.text = ""; myLabel.move(10,10); addChild(myLabel); } function announceSelectedItem(e:Event):void { var sci:SimpleCollectionItem = e.target.selectedItem as SimpleCollectionItem; myLabel.text = "You have selected " + sci.label; } } }