flash on 2010-4-14
/**
* Copyright kihon ( http://wonderfl.net/user/kihon )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/lPez
*/
package
{
import flash.display.Sprite;
import flash.events.Event;
import com.bit101.components.ComboBox;
public class Main extends Sprite
{
public function Main()
{
var box:ComboBox = new ComboBox(this, 0, 0, "Choose an item");
box.addItem("FLASH");
box.addItem("AS3");
box.addItem("String");
box.addItem("Number");
box.addEventListener(Event.SELECT, onSelect);
}
private function onSelect(event:Event):void
{
var box:ComboBox = event.currentTarget as ComboBox;
trace(box.selectedIndex);
trace(box.selectedItem);
}
}
}