combo box update issue

1 view
Skip to first unread message

bda!

unread,
Jun 1, 2010, 4:14:11 PM6/1/10
to Adobe Developers of Greater Orlando
I'm having trouble getting the display of my combo box to update.

with a new FLA and only dragged combobox (cbStuff), and button
(btnAddItem) on the stage,
I add this actionscript to the timeline

var str:String="a b c";
cbStuff.addItem( { label: str } );
cbStuff.selectedIndex=0;
btnAddItem.addEventListener(MouseEvent.CLICK,doAddItem);
function doAddItem(e:Event):void
{
cbStuff.replaceItemAt( { label: str+" d" }, cbStuff.selectedIndex );
}

I wanted to see "a b c d" as the selected item. Instead, "a b c" is
selected and "a b c d" is another choice. When I choose it, the "a b
c" disappears.

I think that the display of the combobox just isn't being updated
until I perform some action on it with the mouse.

Is there some way to force an update?

Brian

Akbar Goldust

unread,
Jun 2, 2010, 3:01:55 AM6/2/10
to ad...@googlegroups.com
HI

it's really Simple
just reset the index of comboBox after setting the lable of that


var str:String="a b c";
cbStuff.addItem( { label: str } );

cbStuff.selectedIndex = 0;

btnAddItem.addEventListener(MouseEvent.CLICK,doAddItem);


function doAddItem(e:MouseEvent):void

{
       cbStuff.replaceItemAt( { label: str+" d" }, cbStuff.selectedIndex );
       cbStuff.selectedIndex = 0;
}


--------------------------------------
Akbar Goldust
 site: www.AlborzSoft.com
email: in...@alborzsoft.com



--
You received this message because you are subscribed to the Google Groups "Adobe Developers of Greater Orlando" group.
To post to this group, send email to ad...@googlegroups.com.
To unsubscribe from this group, send email to adogo+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/adogo?hl=en.


Reply all
Reply to author
Forward
0 new messages