Abrir tela Flex com a tab desejada

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);
}

Seleciona a tab “navB” no creationComplete:

[code]<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx=“http://ns.adobe.com/mxml/2009
xmlns:s=“library://ns.adobe.com/flex/spark”
xmlns:mx=“library://ns.adobe.com/flex/mx” minWidth=“955” minHeight=“600”
creationComplete=“creationCompleteHandler(event)”>

<fx:Script>
	<![CDATA[
		import mx.events.FlexEvent;
		
		private function creationCompleteHandler(event:FlexEvent):void {
			vs.selectedChild = navB;
		}

	]]>
</fx:Script>

<fx:Declarations>
	<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>

<s:TabBar x="10" y="10" dataProvider="{vs}" width="238"/>
<mx:ViewStack x="10" y="40" id="vs" width="687" height="271">
	<s:NavigatorContent id="navA" label="a">
		<s:Label x="6" y="10" text="aaaaaaaaaaaaaaa"/>
	</s:NavigatorContent>
	<s:NavigatorContent id="navB" label="b">
		<s:Label x="6" y="10" text="bbbbbbbbbbbbbbb"/>
	</s:NavigatorContent>
	<s:NavigatorContent id="navC" label="c">
		<s:Label x="6" y="10" text="ccccccccccccccc"/>
	</s:NavigatorContent>
	<s:NavigatorContent id="navD" label="d">
		<s:Label x="6" y="10" text="ddddddddddddddd"/>
	</s:NavigatorContent>
</mx:ViewStack>
<s:Button x="48" y="393" label="Button"/>

</s:Application>[/code]

Ou seja, basta dar um ID para as tabs (s:NavigationContent) e setar a propriedade selectedChild do s:ViewStack.

[]´s

Cara, value pela resposta funciono perfeito!!.

Disponha :wink: