<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nate Beck &#187; ComboBox</title>
	<atom:link href="http://blog.natebeck.net/tag/combobox/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.natebeck.net</link>
	<description>AIR, Flex / Flash, FMS, PushButton, Game... Developer</description>
	<lastBuildDate>Wed, 07 Sep 2011 21:24:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Tip of the Day &#8211; How to create a prompt field on your mx:ComboBox</title>
		<link>http://blog.natebeck.net/2009/04/tip-of-the-day-how-to-create-a-prompt-field-on-your-mxcombobox/</link>
		<comments>http://blog.natebeck.net/2009/04/tip-of-the-day-how-to-create-a-prompt-field-on-your-mxcombobox/#comments</comments>
		<pubDate>Sat, 18 Apr 2009 08:55:55 +0000</pubDate>
		<dc:creator>Nate Beck</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tip of the day]]></category>
		<category><![CDATA[ComboBox]]></category>

		<guid isPermaLink="false">http://blog.natebeck.net/?p=772</guid>
		<description><![CDATA[For a long time I&#8217;ve been doing things like this within Flex. &#91;Bindable&#93; private var _skills:Array = &#91; &#123;label: &#34;---&#34;, id: -1&#125;, &#123;label: &#34;1 - Newbie&#34;, id: 1&#125;, &#123;label: &#34;2 - Some Experience&#34;, id: 2&#125;, &#123;label: &#34;3 - Expert&#34;, id: 3&#125;, &#123;label: &#34;4 - I'm a baller&#34;, id: 4&#125; &#93;; And then binding this data]]></description>
			<content:encoded><![CDATA[<p>For a long time I&#8217;ve been doing things like this within Flex.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span> <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _skills:<span style="color: #0066CC;">Array</span> = 
<span style="color: #66cc66;">&#91;</span>
	<span style="color: #66cc66;">&#123;</span>label: <span style="color: #ff0000;">&quot;---&quot;</span>, id: -<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#125;</span>,
	<span style="color: #66cc66;">&#123;</span>label: <span style="color: #ff0000;">&quot;1 - Newbie&quot;</span>, id: <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#125;</span>,
	<span style="color: #66cc66;">&#123;</span>label: <span style="color: #ff0000;">&quot;2 - Some Experience&quot;</span>, id: <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#125;</span>,
	<span style="color: #66cc66;">&#123;</span>label: <span style="color: #ff0000;">&quot;3 - Expert&quot;</span>, id: <span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#125;</span>,
	<span style="color: #66cc66;">&#123;</span>label: <span style="color: #ff0000;">&quot;4 - I'm a baller&quot;</span>, id: <span style="color: #cc66cc;">4</span><span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#93;</span>;</pre></div></div>

<p>And then binding this data provider to a ComboBox&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:ComboBox</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;skillsCB&quot;</span> <span style="color: #000066;">dataProvider</span>=<span style="color: #ff0000;">&quot;{_skills}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>Well it turns out there is a much easier way of doing this that I never knew of until today.  ComboBox has a &#8220;prompt&#8221; attribute that you can set.  It&#8217;s so easy&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:ComboBox</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;skillsCB&quot;</span> <span style="color: #000066;">dataProvider</span>=<span style="color: #ff0000;">&quot;{_skills}&quot;</span> <span style="color: #000066;">prompt</span>=<span style="color: #ff0000;">&quot;---&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>I told you it was easy.  Can&#8217;t believe I never noticed it before.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.natebeck.net/2009/04/tip-of-the-day-how-to-create-a-prompt-field-on-your-mxcombobox/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

