Link to home
Start Free TrialLog in
Avatar of yahoolane
yahoolane

asked on

Flex 4 S:List how to add text items with code

<s:List id="playerList" x="675" y="20" width="44" height="206" ></s:List>

I want to add List of the Players in my game in code.

something like I
protected function button1_clickHandler(event:MouseEvent):void
 {
          var s: String = "Player 1"
      playerList.adobject(s)
 }
Avatar of deepanjandas
deepanjandas
Flag of India image

Try this:
protected function button1_clickHandler(event:MouseEvent):void
{
     var s: String = "Player 1";
     playerList.addItem({label:s});
}

Open in new window


Warm Regards
Deepanjan Das
Avatar of yahoolane
yahoolane

ASKER

Deep

No addItem for S:List

I am using Flex 4

Lane

ASKER CERTIFIED SOLUTION
Avatar of deepanjandas
deepanjandas
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial