<?xml version="1.0" encoding="utf-8"?>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
<fx:Array id="estados">
<fx:String>Paraiba</fx:String>
<fx:String>Pernambuco</fx:String>
<fx:String>Paraná</fx:String>
<fx:String>Bahia</fx:String>
<fx:String>Acre</fx:String>
</fx:Array>
<fx:Array id="cidades_pb">
<fx:String>João Pessoa</fx:String>
<fx:String>Patos</fx:String>
</fx:Array>
<fx:Array id="cidades_pe">
<fx:String>Recife</fx:String>
<fx:String>Juazeiro</fx:String>
</fx:Array>
<fx:Array id="cidades_pr">
<fx:String>x y z</fx:String>
<fx:String>z y x</fx:String>
</fx:Array>
<fx:Array id="cidades_ba">
<fx:String>Salvador</fx:String>
<fx:String>Juazeiro do Norte</fx:String>
</fx:Array>
</fx:Declarations>
<s:Panel x="145" y="73" width="543" height="383" title="Filtrando dados com Array">
<s:Label x="81" y="66" text="Lista de Estados.:"/>
<s:Label x="81" y="118" text="Lista de Cidades.:"/>
<s:ComboBox id="ComboEstados" dataProvider="{estados}" x="206" y="55" width="206" change="filtraCidadePorEstado();"/>
<s:ComboBox id="ComboCidades" dataProvider="{cidades_pb}" x="206" y="112" width="206"/>
<fx:Script>
<![CDATA[
private function filtraCidadePorEstado():void
{
if (ComboEstados.selectedIndex == 0)
ComboCidades.dataProvider = cidades_pb;
else if (ComboEstados.selectedIndex == 1)
ComboCidades.dataProvider = cidades_pe;
else if (ComboEstados.selectedIndex == 2)
ComboCidades.dataProvider = cidades_pr;
else if (ComboEstados.selectedIndex == 3)
ComboCidades.dataProvider = cidades_ba;
}
]]>
</fx:Script>
</s:Panel>
</s:Application>
A mensagem de erro que aparece é: Description Resource Path Location Type
1067: Implicit coercion of a value of type Array to an unrelated type mx.collections:IList. main.mxml /filtragemDados/src line 44 Flex Problem