Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 12-07-2006, 02:48 AM   #1
rs_ss350
Newbie
 
Join Date: Nov 2006
Location: Oakland, CA
Posts: 13
Default resizing combo box with Actionscript

Hi,

I've got a combo box with labels that are very long... i created the combobox with the following script:
Code:
// combo box
this.createClassObject(mx.controls.ComboBox, "my_cb", 10);

my_cb.addItem({data:"/solutions/industry/aerospace/index.htm", label:"Aerospace and Defense"});
my_cb.addItem({data:"/solutions/industry/automotive/index.htm", label:"Automotive"});
my_cb.addItem({data:"/solutions/industry/consumer/index.htm", label:"Consumer Products"});
my_cb.addItem({data:"/solutions/industry/discrete_manufacturing/index.htm", label:"Discrete Manufacturing"});
my_cb.addItem({data:"/solutions/industry/finance/index.htm", label:"Financial Services"});
my_cb.addItem({data:"/solutions/industry/healthcare/index.htm", label:"Healthcare"});

// Position
my_cb._x = 40;
my_cb._y = 520;

// Parameters
my_cb.rowCount = 13;
my_cb.minWidth = 300;

// Create listener object.
var cbListener:Object = new Object();
// Create event handler function.
cbListener.change = function (evt_obj:Object) {
 trace("Currently selected item is: " + evt_obj.target.selectedItem.label);
 trace("Currently selected url is: " + evt_obj.target.selectedItem.data);
 getURL( evt_obj.target.selectedItem.data, "_blank");

}
// Add event listener.
my_cb.addEventListener("change", cbListener);
i attempted my_cb._width = 300; , but this stretches the down button. is there any way to widen the text area so the whole label shows?

thanks!

Last edited by rs_ss350; 12-07-2006 at 08:04 AM. Reason: typos
rs_ss350 is offline   Reply With Quote
Old 12-07-2006, 03:16 PM   #2
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,106
Default

try:
ActionScript Code:
my_cb.setSize(40,520);

i think this will work for as1.....
__________________
tg
---
what the hell was i thinking?
tg is offline   Reply With Quote
Old 12-07-2006, 04:10 PM   #3
rs_ss350
Newbie
 
Join Date: Nov 2006
Location: Oakland, CA
Posts: 13
Default

Thanks! that worked... learning something new every day thanks to this site...

one more thing, how do I create an inactive label? searched extensively through the flash help, but no luck...

thanks
rs_ss350 is offline   Reply With Quote
Old 12-07-2006, 06:45 PM   #4
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,106
Default

what do you mean by an 'inactive label' ??
__________________
tg
---
what the hell was i thinking?
tg is offline   Reply With Quote
Old 12-07-2006, 08:06 PM   #5
rs_ss350
Newbie
 
Join Date: Nov 2006
Location: Oakland, CA
Posts: 13
Default

what i mean is a disabled list item... it would be the first item in the drop down... it would say something like "choose one.."

thanks
rs_ss350 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
combo box dcullinane Components 9 06-21-2004 11:08 AM
combo box data fmdano Components 1 05-14-2004 11:58 PM
Combo box problem TheBuzz Components 3 03-18-2004 12:43 AM
XML - Dynamic Combo Boxes Plankton ActionScript 1.0 (and below) 0 04-18-2003 09:01 AM
I'm having problems resizing a MC using actionscript... SCHIMKE ActionScript 1.0 (and below) 1 03-10-2003 09:48 AM


All times are GMT. The time now is 03:43 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.