Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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="init(event)">
- <fx:Script>
- <![CDATA[
- //import mx.controls.Alert;
- import mx.events.FlexEvent;
- [Bindable]
- private var labelText:String;
- [Bindable]
- private var myState:String = currentState;
- protected function init(event:FlexEvent):void
- {
- labelText = "HOME";
- currentState = "home";
- myState = currentState;
- }
- protected function ezNav(e:MouseEvent):void
- {
- var nav:String = String(e.target.id);
- currentState = nav;
- myState = currentState;
- labelText = nav.toUpperCase();
- //Alert.show(nav);
- }
- ]]>
- </fx:Script>
- <!-- MXML -->
- <s:states>
- <s:State name="home" />
- <s:State name="about" />
- <s:State name="bio" />
- </s:states>
- <s:Panel title="States of Being">
- <s:VGroup>
- <s:HGroup>
- <s:Button id="home" label="Home" click="ezNav(event)" />
- <s:Button id="about" label="About" click="ezNav(event)" />
- <s:Button id="bio" label="Bio" click="ezNav(event)" />
- </s:HGroup>
- <s:Label text="This is the {labelText} page! This shows up in all states with just the one word changing." />
- <s:Label includeIn="home" text="This only shows up in the {myState} state!" fontSize="30" />
- <s:Label includeIn="about" text="This only shows up in the {myState} state!" fontSize="30" />
- <s:Label includeIn="bio" text="This only shows up in the {myState} state!" fontSize="30" />
- </s:VGroup>
- </s:Panel>
- </s:Application>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement