-
(mx2004) combobox top text
Hi,
I'm having trouble getting a selected text to appear at the top of a combobox... I'm attaching it like this
Code:
var pullDown:ComboBox = attachMovie('ComboBox', 'myPullDown', 450);
pullDown.addItem('item1');
pullDown.addItem('item2');
...
pullDown.selectedIndex=0;
and then selecting the top item to be shown... but though the item appears selected when the list drops down, it doesn't appear at the top. Even when I select it manually, the label doesn't show at the top... I thought this would be standard functionality for a comboBox? How do I get it show?
thanks in advance for any responses,
3rdw0rld3r
-
update
I posted the wrong code by mistake, here's the right one:
Code:
var pullDown:ComboBox = createClassObject(mx.controls.ComboBox, "myPullDown", 450);
pullDown.addItem('item1');
pullDown.addItem('item2');
...
pullDown.selectedIndex=0;
sorry, not enough sleep...
-
Italy
well, it about half year after ya asked this question but i got this problem too and i found the right code.
Code:
var c:ComboBox;
c.addItem("food",0);
c.addItem("clothes",1);
c.addItem("tour"),2;
c.selectedIndex = 2;
this code tell the comboBox that "tour" will be the selected value and will be shown at the textfield.
hope it helped any1.
Last edited by Novik2000; 06-02-2010 at 04:28 AM.
-
Hi Avi,
thanks for your reply... I fixed this way back when, but don't remember how. your code looks the same as mine, only for explicitly defining the position?
best
Oliver
-
Italy
well i didnt understand what u mean but yes, my code is like your, it just looks simplier... i think.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|