Pessoal, quero abrir um tela do meu projeto Flex e quero que quando abrir venha aberta uma tab especifica. Como faço isso ?
<s:TabBar id="tabs" left="14" y="12" dataProvider="{vs}"/>
<mx:ViewStack id="vs" width="990" height="401" left="8" y="23">
<s:NavigatorContent label="Cadastrar" width="100%" height="100%">
<s:BorderContainer width="989" height="385" borderWeight="2" cornerRadius="3" dropShadowVisible="true" y="10">
<mx:Form x="10" y="14" width="725" height="318" defaultButton="{salvar}" creationComplete="popularCliente(),popularComponentes()">
<mx:FormItem label="Código:">
<s:TextInput id="inputCodigo" width="70" enabled="false"/>
</mx:FormItem>
<mx:FormItem label="Numero:">
<mx:NumericStepper id="inputNumero" width="70" maximum="999999999"/>
</mx:FormItem>
<mx:FormItem label="Componente:">
<s:ComboBox id="comboComponentes" width="266" selectedIndex="0"/>
</mx:FormItem>
<mx:FormItem label="Versão:">
<s:TextInput id="inputVersao"/>
</mx:FormItem>
<mx:FormItem label="Data Inicio:">
<mx:DateField id="inputDataInicio"/>
</mx:FormItem>
<mx:FormItem label="Data Fim:">
<mx:DateField id="inputDataFim"/>
</mx:FormItem>
<mx:FormItem label="Tamanho Estimado PF:">
<s:NumericStepper id="inputTamanhoEstimadoPF" width="70" maximum="999999999"/>
</mx:FormItem>
<mx:FormItem label="Tamanho PF itens não mensuráveis:">
<mx:NumericStepper id="inputTamanhoNaoMensuravelPF" width="70" maximum="999999999"/>
</mx:FormItem>
<mx:FormItem label="Cliente:">
<s:ComboBox id="comboClientes" width="266" selectedIndex="0"/>
</mx:FormItem>
<mx:FormItem label="Estado:">
<s:ComboBox id="comboStatus" dataProvider="{comboStatusProjeto}" selectedIndex="0"/>
</mx:FormItem>
</mx:Form>
<s:Button id="limpar" label="Limpar" click="limparCadastroProjeto();" x="217" y="343"/>
<s:Button id="salvar" label="Salvar" click="inserir();" toolTip="Salvar" x="126" y="342"/>
</s:BorderContainer>
</s:NavigatorContent>
<s:NavigatorContent label="Listar" width="100%" height="100%">
<s:BorderContainer width="991" height="386" borderWeight="2" cornerRadius="3" dropShadowVisible="true" y="10">
<mx:DataGrid id="dg" x="5" y="5" width="968" height="329" doubleClickEnabled="true" doubleClick="{tabs.selectedIndex=0}" change="selectedItems()" creationComplete="listar()">
<mx:columns>
<mx:DataGridColumn headerText="Código" dataField="id" width="50"/>
<mx:DataGridColumn headerText="Numero" dataField="codigo"/>
<mx:DataGridColumn headerText="Cliente" dataField="nome_cliente"/>
<mx:DataGridColumn headerText="Componente" dataField="nome_componente"/>
<mx:DataGridColumn headerText="Versão" dataField="versao"/>
<mx:DataGridColumn headerText="Data Inicio" dataField="data_inicio" labelFunction="{formataDataInicio}"/>
<mx:DataGridColumn headerText="Data Fim" dataField="data_fim" labelFunction="{formataDataFim}"/>
<mx:DataGridColumn headerText="Tamanho PF" dataField="tamanho_estimado"/>
<mx:DataGridColumn headerText="Estado" dataField="estado" labelFunction="{verificaEstado}"/>
<mx:DataGridColumn headerText="Os(s)">
<mx:itemRenderer>
<fx:Component>
<mx:Image horizontalAlign="center" source="assets/img/lupa.png" click="abrir()" height="16" width="16"/>
</fx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
<s:Button id="apagar" label="Apagar" click="confirmaExcluir();" x="8" y="346" toolTip="Apagar"/>
</s:BorderContainer>
</s:NavigatorContent>
<s:NavigatorContent label="Gráfico" width="100%" height="100%">
<s:BorderContainer width="990" height="391" borderWeight="2" cornerRadius="3" dropShadowVisible="true" y="10">
<mx:BarChart x="12" y="10" id="barchart1" height="331" width="464">
<mx:series>
<mx:BarSeries displayName="Series 1" xField=""/>
<mx:BarSeries displayName="Serie2" xField=""/>
</mx:series>
</mx:BarChart>
<mx:Legend dataProvider="{barchart1}" x="500" y="50"/>
</s:BorderContainer>
</s:NavigatorContent>
</mx:ViewStack>
//Metodo que vai ser chamado quando clicar na imagem, ou
ser clicado quero que abra uma nova tela com a tab = listar abertar.
public function abrir():void{
if(dg.selectedIndex < 0)
return;
var a:OsView = new OsView();
//var id:int = dg.dataProvider[dg.selectedIndex].id;
a.tabs.selectedIndex(0);
PopUpManager.addPopUp(a,this.parent,false);
}