Go Back   CodingForums.com > :: Client side development > Flash & ActionScript > Adobe Flex

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-05-2008, 05:17 PM   PM User | #1
jerry62704
Senior Coder

 
jerry62704's Avatar
 
Join Date: Oct 2007
Location: Springfield, IL
Posts: 1,049
Thanks: 9
Thanked 82 Times in 82 Posts
jerry62704 is on a distinguished road
Question Design - add to combo box

How do I add options to a combo box? The first one I'm working with will be a Yes/No. Radio button or check boxes are not an option in this case.
__________________
.
.
...and gladly would he learn and gladly teach

Visit www.LiberalsWin.com for humor and the unique Bush/Obama Approval Polls
jerry62704 is offline   Reply With Quote
Old 11-07-2008, 02:36 PM   PM User | #2
jerry62704
Senior Coder

 
jerry62704's Avatar
 
Join Date: Oct 2007
Location: Springfield, IL
Posts: 1,049
Thanks: 9
Thanked 82 Times in 82 Posts
jerry62704 is on a distinguished road
As no one seem to know how to do this, and I just found out how, I'll post the solution. There are two, but I don't know the other one yet.

Code:
<mx:FormItem id="householdExceptionsLabel"
	label="Household Exceptions"
	top="35" right="5"
	horizontalAlign="right">
	<mx:ComboBox
		id="householdExceptionsData"
		width="75">
		<mx:dataProvider>
			<mx:ArrayCollection>
				<mx:String>Yes</mx:String>
				<mx:String>No</mx:String>
			</mx:ArrayCollection>
		</mx:dataProvider>
	</mx:ComboBox>
</mx:FormItem>
__________________
.
.
...and gladly would he learn and gladly teach

Visit www.LiberalsWin.com for humor and the unique Bush/Obama Approval Polls
jerry62704 is offline   Reply With Quote
Old 11-12-2008, 05:07 PM   PM User | #3
jerry62704
Senior Coder

 
jerry62704's Avatar
 
Join Date: Oct 2007
Location: Springfield, IL
Posts: 1,049
Thanks: 9
Thanked 82 Times in 82 Posts
jerry62704 is on a distinguished road
Found the second way. This involves using a script.

This is the control:
Code:
<mx:FormItem id="householdExceptionsLabel"
	label="Household Exceptions"
	top="32" right="5"
	horizontalAlign="right">
	<mx:ComboBox id="householdExceptionsData"
		width="75"
		dataProvider="{englishYesNo}" />
</mx:FormItem>
This is the script:
Code:
<mx:Script>
	<![CDATA[
		import mx.collections.ArrayCollection;
		import mx.controls.Alert;

		[Bindable]
		private var englishYesNo:ArrayCollection = 
			new ArrayCollection([
			"Yes",
			"No"]);
...
		for (i=0;i<1;i++)
		{
			householdExceptionsData.dataProvider[i] = englishYesNo[i];
			householdTANFData.dataProvider[i] = englishYesNo[i];
		}
There is a language test that uses either the spanishYesNo (not shown) or the englishYesNo variable.

Hope this is helpful to anyone else.
__________________
.
.
...and gladly would he learn and gladly teach

Visit www.LiberalsWin.com for humor and the unique Bush/Obama Approval Polls
jerry62704 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:56 AM.


Advertisement
Log in to turn off these ads.