my_cb.embedFonts = true; my_cb.setStyle("fontFamily", "Verd"); // Add Items to Combo Box. my_cb.addItem({data:1, label:"The Introduction"}); my_cb.addItem({data:2, label:"Destination: Fuckstixx!"}); my_cb.addItem({data:3, label:"Capital Punishment"}); my_cb.addItem({data:4, label:"One... Two... Three... Sex Machine"}); my_cb.addItem({data:5, label:"Don't Walk"}); my_cb.addItem({data:6, label:"Wakeboarding Sasquatch"}); my_cb.addItem({data:7, label:"Fuckstixx Wasted"}); my_cb.addItem({data:8, label:"Break Your Bones"}); my_cb.addItem({data:9, label:"Fuckstixx Dance Mix 2006"}); my_cb.addItem({data:10, label:"Cuisine Machine"}); my_cb.addItem({data:11, label:"Great White South"}); my_cb.addItem({data:12, label:"Mimes"}); my_cb.addItem({data:13, label:"Lady O'Lane"}); my_cb.addItem({data:14, label:"The Trouble Brewery"}); my_cb.addItem({data:15, label:"Space Travel is Rough Stuff Mon Frere"}); //my_cb.selectedIndex = 0; // Add event listener and event handler function. var cbListener:Object = new Object(); cbListener.change = function(evt_obj:Object):Void { var currentlySelected:Object = evt_obj.target.selectedItem; trace("data: "+currentlySelected.data); trace("label: "+currentlySelected.label); _root.loadMp3(currentlySelected.data); }; my_cb.addEventListener("change", cbListener); _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
For some reason the change event handle will not trigger for item 1 in
the combobox gets selected unless I first select item 2+ then go back
and try again. Otherwise if I try to click on the first item, it doesnt
do anything, no traces happen. Any ideas what would cause the first
item to not trigger a change event and all the rest do?