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

Parameters Name Description
Returns Returns
Example
    None


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

Parameters pOwner The movie clip on which the new ComboBox will be drawn
strName The new ComboBox instance name
nDepth The new ComboBox instance depth
Returns The reference to the new ComboBox instance
Example
    // layer for comboboxes popup lists and other objects with the similar behaviour
    _global.popup = pseudo.BaseMovie.create(_root, "m_mcPopup", 4);
    
    //create instance of the ComboBox class
    var m_cmb = pseudo.ComboBox.create(this, "cmb", 2);
    m_cmb.setSize(100, 20);
    
    //Apply the skin to the ComboBox
    
    m_cmb.setLook(pseudo.look.XPLook.getInstance());
    
    //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});
    
    m_cmb.setListData(data);
    
    m_cmb.setEdit(false);
    m_cmb.setSelId(0);
    
    //Add an event listener to the ComboBox
    
    m_cmb.addListener("changed", pThis, onDoSomething);
    
    //Calling these functions will finally draw the component
    
    m_cmb.update();
    m_cmb.draw();
    
    //Some function fo to handle "changed" event
    
    function onDoSomething():Void
    {
      trace(m_cmb.getSelData().text + " " + m_cmb.getSelData().data)
    }
    
    // This code will draw the ComboBox fields 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.ComboBox.getListData():Array
Returns the reference to the data array associated with this ComboBox

Parameters None
Returns Array value
Example
    None


pseudo.ComboBox.setListData(arrData:Array):Void
Function that sets the data associated with the combobox. The data array that is the array of the objects. Each object in the array should have the property "text" initialized with some string that will be displayed in the combobox list. You can add more properties to these objects as many as you want.

Parameters arrData Array value
Returns Nothing
Example
    //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});
    
    m_cmb.setListData(data);
           


pseudo.ComboBox.setSelId(nId:Number):Void
Sets the selected item of the combobox using the index number.

Parameters nId Number value
Returns Nothing
Example
    None


pseudo.ComboBox.setMultiline(bMultiline:Boolean):Void
If the value passed into the function is true, the label a multilane text ; if the value is false, the label is a single-line text.

Parameters bMultiline Boolean value
Returns Nothing
Example
    None


pseudo.ComboBox.getSelId():Number
Returns the selected combobox item id.

Parameters None
Returns Number value
Example
    None


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

Parameters None
Returns Object
Example
    None


pseudo.ComboBox.getField():TextField
Returns TextField instance that is wrapped by the label.

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