Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- call:
- // Create data provider for combobox
- combobox_data_01 = new DataProvider();
- combobox_data_01.addItem({label:"Air Conditioner"});
- combobox_data_01.addItem({label:"Tumble Dryer"});
- combobox_data_01.addItem({label:"Hot Water Heater"});
- combobox_data_01.addItem({label:"Television"});
- combobox_data_01.addItem({label:"Miscrowave"});
- // Create ComboBox
- combobox_01 = make_combobox("ComboBox 01", combobox_data_01, combobox_01_x, combobox_01_y, combobox_01_width)
- function:
- function make_combobox(Name:String, dataprovider:DataProvider, X:int, Y:int, W:int):ComboBox
- {
- var combobox:ComboBox;
- // Create ComboBox
- combobox = new ComboBox();
- combobox.name = Name;
- combobox.dataProvider= dataprovider;
- combobox.addEventListener(Event.CHANGE, do_combobox);
- combobox.visible = false;
- // Set the position of the combobox
- combobox.x = X;
- combobox.y = Y;
- // Set the dimensions of the combobox
- combobox.width = W;
- // Set rowcount of combobox to display all items
- combobox.rowCount = combobox.length;
- // Place combobox on the stage
- addChild(combobox);
- return combobox
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement