PDA

View Full Version : Closed ComboBox text not showing


seanlail
07-05-2007, 05:10 PM
Hi all,

I've got a ComboBox, in an mc that is attached at runtime.

I've read the posts about components being buggy when in a swf that gets loaded into another swf. So that's not the issue.

The selected item is just blank?

If I click and open the ComboBox I can see other content inside.
Even if I select something and then the ComboBox closes, I still see nothing?

Using Flash 8 and AS2.

LOLFlash
07-05-2007, 06:07 PM
Probably you set
selectedItem = 5;

But it should be
selectedIndex =5;

seanlail
07-10-2007, 02:18 PM
Nope, that's not the problem.
It happens when I use a class instead of including a script.

Attached the files.

Weird???

mooska
07-10-2007, 03:03 PM
dont do it in the constructor
public function onLoad()
{

myCombo.useHandCursor = false;
myCombo._focusrect = false;

myCombo._x = 10;
myCombo._y = 10;
/*
and here the rest
*/
}

or like this, not much of a difference, but looks better :)
public function onLoad()
{
init();
}
public function init(){/* in here you code */}

move to onLoad at least this part

for (var i:Number = 0; i < comboLabel.length; i++) {
myDP.addItem({label: comboLabel[i], data: i});
}
myCombo.dataProvider = myDP

seanlail
07-10-2007, 05:12 PM
Great! Thanks a lot!