Dae pessoal.
Estou iniciando ainda no FX4 ou Flash Builder como queiram, então tenho minhas dificuldades ainda, mas é muito bom o resultado que estou vendo. Esse dias me deparei com alguns problemas com states que no Flex 3 eu fzia algo do tipo:
Fx3
<mx:State name="logonState"> <mx:SetProperty target="{textInputNome}" name="visible" value="true" />
Bom as mudanças para o FX4 foram muitas onde no próprio componente adicionamos essas propriedades.
Logo no inicio fiquei de cara achava mais dificil sei la, mas achei que é algo que melhorou muito, ou seja,
sim ficou melhor ja me acostumei e achei mais “clean” o negocio.
veja o exemplo que fiz abaixo:
FX4
e o Codigo fica esse
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" currentState="state1" viewSourceURL="srcview/index.html"> <fx:Declarations> ? fx:Declarations> <fx:Script> [CDATA[ import mx.collections.ArrayCollection; ? import spark.events.IndexChangeEvent; [Bindable] private var arrayCollection:ArrayCollection=new ArrayCollection([ {prop:'state1'},{prop:'state2'}]); ? ? ? ? protected function comboBox_changeHandler(event:IndexChangeEvent):void { this.currentState=comboBox.selectedItem.prop; } ? ]]> fx:Script> <s:states> <s:State name="state1"/> <s:State name="state2"/> s:states> <mx:Form> <mx:FormItem> <s:TextInput id="textInput1" text.state1="FELIPE" text.state2="BORELLA"/> mx:FormItem> <mx:FormItem> <s:TextInput id="textInput2" text.state1="BORELLA" text.state2="FELIPE"/> mx:FormItem> <mx:FormItem> <s:ComboBox id="comboBox" labelField="prop" dataProvider="{arrayCollection}" change="comboBox_changeHandler(event)" selectedIndex="0"/> mx:FormItem> mx:Form> s:Application>
Felipe!




