Phil, have a go at this then...please forgive any typos.   Change the combo
box to this and add the method below

<mx:ComboBox id="stateCombo" labelField="state"
data="state" width="60"
change="handleChange( event )"/>

and add

import mx.controls.Alert;

private function handleChange( event : Event ) : void
{
     Alert.show(event.target.selectedItem.toString());
}

This should tell you what the selectedItem looks like.  A first step in
debugging your issue.

One thing you have to realize and remember is that, the selectedItem
property is a reference to the object in your dataProvider.  Thus any
property in your dataProvider is in selectedItem.  Hence, label will not
exist.  Depending on the type of objects in your dataProvider, this may or
may not throw a error.    Thus what you probably need is
event.target.selectedItem.state.

HTH

DK


On 10/21/07, Phill B <[EMAIL PROTECTED]> wrote:
>
> Thanks for the links Douglas but I have read those. I can get the
> comboBox to pass vars from an array to a function. When I use the same
> concept to pass the selectedItem from the results of a query to a
> function, all I get is an empty var. The docs you sent didn't seam to
> explain why that would happen or how to do it correctly.
>
> I have searched all over the web to see what would cause this problem
> and how to do it correctly. I haven't had much luck so far. Can you
> help me understand what I need to do to get this to work?
>
> On 10/20/07, Douglas Knudsen <[EMAIL PROTECTED]> wrote:
> > Its quite easy!  I suggest, and I don't mean to come across too bluntly
> > here, you read the API:
> http://livedocs.adobe.com/flex/2/langref/index.html
> >
> > Specifically for this thread, see here
> > http://livedocs.adobe.com/flex/2/langref/mx/controls/ComboBox.html
> > looking at the events section, the close event really isn't what is
> needed
> > here.  Rather, should use the change event.
> >
> > DK
> >
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648

Archive: http://www.houseoffusion.com/groups/Flex/message.cfm/messageid:4735
Subscription: http://www.houseoffusion.com/groups/Flex/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.37

Reply via email to