Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. call:
  2.  
  3. // Create data provider for combobox
  4.     combobox_data_01 = new DataProvider();
  5.     combobox_data_01.addItem({label:"Air Conditioner"});
  6.     combobox_data_01.addItem({label:"Tumble Dryer"});
  7.     combobox_data_01.addItem({label:"Hot Water Heater"});
  8.     combobox_data_01.addItem({label:"Television"});
  9.     combobox_data_01.addItem({label:"Miscrowave"});
  10.    
  11.     // Create ComboBox
  12.     combobox_01 = make_combobox("ComboBox 01", combobox_data_01, combobox_01_x, combobox_01_y, combobox_01_width)
  13.  
  14. function:
  15.  
  16. function make_combobox(Name:String, dataprovider:DataProvider, X:int, Y:int, W:int):ComboBox
  17. {
  18.     var combobox:ComboBox;
  19.    
  20.     // Create ComboBox
  21.     combobox = new ComboBox();
  22.     combobox.name = Name;
  23.     combobox.dataProvider= dataprovider;
  24.     combobox.addEventListener(Event.CHANGE, do_combobox);
  25.     combobox.visible = false;
  26.    
  27.     // Set the position of the combobox
  28.     combobox.x = X;
  29.     combobox.y = Y;
  30.    
  31.     // Set the dimensions of the combobox
  32.     combobox.width = W;
  33.    
  34.     // Set rowcount of combobox to display all items
  35.     combobox.rowCount = combobox.length;
  36.    
  37.     // Place combobox on the stage
  38.     addChild(combobox);
  39.    
  40.     return combobox
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement