3 Replies Latest reply on May 12, 2010 3:53 PM by rcanulla

    State change not updating everything.

    rcanulla Level 1

      Anyone have any thoughts? The view is changing. It updates in design mode but not when i run it.

       

           <s:RichEditableText id="temp" text="78.2" 
                                    x.card="100" y.card="100"
                                    x.channel="200" y.channel="200"
                                    x.focus="300" y.focus="300"
                                    />
      
      

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" 
                 xmlns:s="library://ns.adobe.com/flex/spark" 
                 xmlns:mx="library://ns.adobe.com/flex/mx" 
                 xmlns:catalyst="components.*"
                 width.card="{100}" height.card="{100}"
                 width.focus="100}" height.focus="{100}"
                 width.channel="{100}" height.channel="{100}"
                 currentState="card" creationComplete="init();" >
           
           <fx:Script>
                <![CDATA[
      
                     this.addEventListener(Event.ENTER_FRAME, onEnterFrame);
                     }
                     private function onEnterFrame(e:Event){
                          trace(this.currentState);
                     }
                ]]>
           </fx:Script>
      
           <s:states>
                <s:State name="card"/>
                <s:State name="channel"/>
                <s:State name="focus"/>
           </s:states>
           
           <s:layout>
                <s:BasicLayout/>
           </s:layout>     
      
           <fx:Declarations>
                <!-- Place non-visual elements (e.g., services, value objects) here -->
           </fx:Declarations>
           
           <s:Rect x="0" y="0"  
                     height="100%" width="100%">
                <s:fill>
                     <s:LinearGradient>
                          <s:entries>
                               <mx:GradientEntry color="0x53C8EA"/>
                          </s:entries>
                     </s:LinearGradient>
                </s:fill>
           </s:Rect>
           
           <s:RichEditableText id="temp" text="78.2" 
                                    x.card="100" y.card="100"
                                    x.channel="200" y.channel="200"
                                    x.focus="300" y.focus="300"
                                    />
           
      
           <s:Button x="100" y="200" label="card" click="{currentState='card'}" />
           <s:Button x="100" y="300" label="channel" click="{currentState='channel'}" />
           <s:Button x="100" y="400" label="focus" click="{currentState='focus'}" />
           
           
      </s:Group>