Change state in LinkButton click event handler : LinkButton « Components « Flex






Change state in LinkButton click event handler

Change state in LinkButton click event handler
       


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:states>
        <mx:State name="contact">
            <mx:AddChild position="lastChild">
                <mx:Panel x="200" y="10" width="250" height="150" layout="absolute" title="Question">
                    <mx:Label x="10" y="10" text="Enter your name:" />
                    <mx:TextInput x="10" y="36" />
                    <mx:Button x="10" y="60" label="Submit" click="currentState = 'thankYou'" />
                </mx:Panel>
            </mx:AddChild>
        </mx:State>
        <mx:State name="thankYou" basedOn="contact">
            <mx:AddChild position="lastChild">
                <mx:Panel x="71" y="200" width="250" height="100" layout="absolute" title="Thank You">
                    <mx:Text x="10" y="10" text="Thank you." width="198" />
                    <mx:Button x="82" y="43" label="OK" click="currentState = ''" />
                </mx:Panel>
            </mx:AddChild>
        </mx:State>
    </mx:states>
    <mx:Panel x="10" y="10" width="250" height="100" layout="absolute" title="Title">
        <mx:Text x="10" y="5" text="test." width="210" />
        <mx:LinkButton x="10" y="34" label="Click Here to E-mail Us" color="#0000FF" click="currentState = 'contact'" />
    </mx:Panel>
</mx:Application>

   
    
    
    
    
    
    
  








Related examples in the same category

1.Add space between LinkButton and ButtonAdd space between LinkButton and Button
2.Handle click event for LinkButton through click event from its containerHandle click event for LinkButton through click event from its container
3.Define a LinkButton with Define a LinkButton with <mx:LinkButton>
4.Use LinkButton to open a URL in a web browser windowUse LinkButton to open a URL in a web browser window
5.Use LinkButton in a ViewStack navigator containerUse LinkButton in a ViewStack navigator container
6.Navigate to a URL with LinkButtonNavigate to a URL with LinkButton
7.LinkButton click handlerLinkButton click handler
8.Set label for LinkButtonSet label for LinkButton
9.LinkButton for changing the stateLinkButton for changing the state
10.A single LinkButton control that opens a URL in a web browser windowA single LinkButton control that opens a URL in a web browser window
11.LinkButton controls for navigating in a ViewStack navigator containerLinkButton controls for navigating in a ViewStack navigator container