all groups > flash actionscript > july 2004 >
You're in the

flash actionscript

group:

ComboBox Drop-Down Mis-Aligns


Re: ComboBox Drop-Down Mis-Aligns Brad
7/1/2004 5:13:26 PM
flash actionscript:
Since only one combo box drop down should appear at a time, you can fix
this by calling

on(change){

myComboBox.swapDepths(0);

// other code

}

in the actionscript attached to myComboBox. You need to do this for each
comboBox instance to make it work. This code causes whichever comboBox
has changed to get depth 0. For some reason the comboBox component won't
work right otherwise.

[quoted text, click to view]
ComboBox Drop-Down Mis-Aligns Kenny
7/1/2004 5:28:57 PM
I am trying to create a bunch of dynamic ComboBox's into a form (FlashMX
2004 Pro). If I create a ComboBox with a depth other than 0, when you
click on it, the drop down options container is mis-aligned off to the
left and up.

If I create them all at depth 0 they override each other so only the
last created is visible.

Any ideas?

Code:

var form = frmGameResults.myAccordion.teamList;

for (i = 0; i < _number_players; i++) {
cboPlayer = form.createClassObject(ComboBox, "cboPlayer" + i,
form.getNextHighestDepth());
Re: ComboBox Drop-Down Mis-Aligns Kenny
7/1/2004 6:38:09 PM
Additionally, when the list is populated and you select an item, the
selected item is not visible in the ComboBox.

[quoted text, click to view]
Re: ComboBox Drop-Down Mis-Aligns Brad
7/1/2004 11:25:58 PM
I'm glad you got it working Kenny. Apparently your solution is more
complex than I understood. It is clear however that comboBox display is
closely coupled to depth parameters. Using swapDepths(0) works in my
script because all comboBox instances are on _level0 and 0 depth
switches to any instance with current focus. It may not work the same
Re: ComboBox Drop-Down Mis-Aligns Kenny
7/2/2004 1:39:59 PM
Thanks for your idea Brad. Unfortunately it didn't work quite right.

I have got it working correctly now, by setting a negative depth value.
I have no idea why this is necessary, nor how to effectively manage
the depths when I am creating an unknown amount of menus (and other
components).

[quoted text, click to view]
AddThis Social Bookmark Button