pseudo.List class
View Sample :: Return to index  
pseudo.List.List(pThis:MovieClip)
RadioButton constructor. You never use the constructor to create this component.

Parameters None
Returns Nothing
Example
    None


pseudo.List.create(pOwner:MovieClip, strName:String, nDepth:Number):pseudo.List
Use this static function to create new List on the specified movie clip. Never use constructor directly to do it.

Parameters pOwner The movie clip on which the new List will be drawn.
strName The new List instance name.
nDepth The new List instance depth.
Returns The reference to the new List instance
Example
    //create instance of the List class
    var list = pseudo.List.create(this, "list", 2);
    list.setSize(100, 20);
    
    //Apply the skin to the List
    
    list.setLook(pseudo.look.XPLook.getInstance());
    
    //Set cell class that will be used to render the list items. Here we use a simple text renderer,
    
    //that comes together with the components package
    
    //but you can write the cell class that will be rendering a complex movie clips in the list items
    list.setCellClass(classes.CellText);
    
    //Add some data to combobox
    var data:Array = new Array({text:"Item One", data:1},
                                                     {text:"Item Two", data:2},
                                                     {text:"Item Three", data:3},
                                                     {text:"Item Four", data:4});
    
    list.setListData(data);
    
    list.setEdit(false);
    list.setSelId(0);
    
    //Add an event listener to the List
    
    list.addListener("changed", pThis, onDoSomething);
    
    //Calling these functions will finally draw the component
    
    list.update();
    list.draw();
    
    //Some function to handle "changed" event
    
    function onDoSomething():Void
    {
      trace(list.getSelData().text + " " + list.getSelData().data)
    }
    
    // This code will draw the List element using XP look and feel skin.
    // Please notice that you should always use some skin to create the component,
    // this can be done like in this example, and the skin will be compiled into the swf file,
    // or you can use another technique and load the skin at a run time.
           


pseudo.List.getListData():Array
Returns the reference to the data array associated with this List.

Parameters None
Returns Array value
Example
    None


pseudo.List.setListData(arrData:Array):Void
Function that sets the data associated with the list. The data array that is the array of the objects. You can add more properties to these objects as many as you want.

Parameters arrData Array value
Returns Nothing
Example
    //Add some data to list
    var data:Array = new Array({text:"Item One", data:1},
                                                     {text:"Item Two", data:2},
                                                     {text:"Item Three", data:3},
                                                     {text:"Item Four", data:4});
    
    list.setListData(data);
           


pseudo.List.setSelCell(nCell:Number, mode:String):Void
Sets the selected item of the list using the index number, the mode paramer indicates how the the list item will be rendered and what even should be fired the following three values are possible: " press", "over", "out", the default value is "press".

Parameters nCell Number value
mode String value
Returns Nothing
Example
    None


pseudo.List.getSelId():Number
Returns the selected list item id

Parameters None
Returns Number value
Example
    None


pseudo.List.getSelData():Object
Returns the selected item data object.

Parameters None
Returns Object
Example
    None


pseudo.List.setCellClass(pClass:Function):Void
Sets the cell class that will be used to render list items. ????

Parameters pClass Function value
Returns Nothing
Example
    None


pseudo.List.setUpdated(bUpdated:Boolean):Void
This function is used to indicate if the list should be udated (re-rendered).

Parameters bUpdated Boolean value
Returns Nothing
Example
    None


pseudo.List.setType(strType:String):Void


Parameters strType String value
Returns Nothing
Example
    None
Flash UI Components (c)TUFaT.com, All Rights Reserved.