In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

minimalcomps ComboBoxについて

スクロールした下のほうは正しく選択できない??


追記
wonderflに入っているバージョンのminimalcomsの既知のバグだったみたい。。
Get Adobe Flash player
by 9balls 18 Oct 2011
/**
 * Copyright 9balls ( http://wonderfl.net/user/9balls )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/2dN8
 */

// forked from kihon's flash on 2010-4-14
package
{
    import flash.text.TextField;
    import flash.display.Sprite;
    import flash.events.Event;
    import com.bit101.components.ComboBox;
 
    public class Main extends Sprite
    {
        private var tf:TextField
        public function Main()
        {
            tf = new TextField();
            tf.y = 200;
            tf.text = "index :\nitem :"
            addChild(tf);
            //
            var box:ComboBox = new ComboBox(this, 0, 0, "Choose an item");
            box.addItem("item0");
            box.addItem("item1");
            box.addItem("item2");
            box.addItem("item3");
            box.addItem("item4");
            box.addItem("item5");
            box.addItem("item6");
            box.addItem("item7");
            box.addItem("item8");
            box.addItem("item9");
 
            box.addEventListener(Event.SELECT, onSelect);
        }
 
        private function onSelect(event:Event):void
        {
            var box:ComboBox = event.currentTarget as ComboBox;
            tf.text = "index : " + box.selectedIndex + "\nitem : " + box.selectedItem;
        }
    }
}