dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: combo box with icons

  1. #1
    Junior Member
    Join Date
    Oct 2008
    Posts
    14

    combo box with icons

    Hi all,

    I have searched a lot for this here and other places and not found a straight forward answer. I dont know why because i am guessing a lot of people would like to use this or maybe i just havent found the obvious! :-).

    Im looking to have a combobox dropdown with the name of an operating system along side its logo ie
    Image -> Red Hat 5

    This is my code so far
    Code:
            
    
    
    var the_test_image = getAndLoadAnImage('server_1.gif');//Loads a test image into the test_image object
    
    var control_box = new ComboBox();
    control_box.dropdownWidth = 210; 
    control_box.setSize(130, 22);
    control_box.move(gs_objects_x_value, gs_operating_system_y_value); 
    var current_saved_value = String(netmap.getAttribute(server_name,'operating_system'));
    		
    for(var i:int = 0;i <operating_systems_value_array.length;i++)
    {
        control_box.addItem( { label: operating_systems_value_array[i], data:i } );
    }

  2. #2
    Junior Member
    Join Date
    Oct 2008
    Posts
    14
    Well i found the solution myself and here it is.

    var control_box = new ComboBox();



    control_box.dropdownWidth = 210;
    control_box.setSize(130, 22);
    control_box.dropdown.rowHeight = 25;
    control_box.move(a_value,b_value );

    for(var i:int = 0;i <operating_systems_value_array.length;i++)
    {

    /*
    This next line just loads images (loaders) from an array (this is a dictionary object that contains the images to quickly change between)
    */

    the_op_sys_image = getAndLoadAnImage('operating_sys_icons/' + operating_systems_value_array[i] + '.gif');
    control_box.addItem( { label: operating_systems_value_array[i], icon:the_op_sys_image} );
    }

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center