title: Select value of a DropDownList via actionscript in Flex 4
body: <p>I'm sure this is a easy one but I've been searching for a while how to select a DropDownList element with actionscript. In this scenario, I'd like to be able to specify the selectedItem based either on ddlLabel or ddlData</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  </code></pre>
  
  <p>
      
          
      </p>
  
  <pre><code>&lt;fx:Script&gt;
      &lt;![CDATA[
          import mx.collections.ArrayCollection;
          import mx.events.FlexEvent;
  
          [Bindable]
          protected var timezonesArray:ArrayCollection = new ArrayCollection([
              {ddlLabel:"Eastern Time", ddlData:"EST"}, 
              {ddlLabel:"Central Time", ddlData:"CST"}, 
              {ddlLabel:"Mountain Time", ddlData:"MST"}, 
              {ddlLabel:"Pacific Time", ddlData:"PST"}
          ]);
  
          protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void
          {
              // I'm looking to select an element via actionscript here, based on ddlLabel or ddlData
          }
  
      ]]&gt;
  &lt;/fx:Script&gt;
  
  &lt;mx:Form&gt;
      &lt;s:DropDownList id="ddlTimezones" dataProvider="{timezonesArray}" labelField="ddlLabel"/&gt;
  &lt;/mx:Form&gt;
  </code></pre>
  
  <p></p>