示例 <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" verticalAlign="middle" width="340" height="250" > <!-- The states property of the Application class defines the view states. --> <mx:states>
<!-- The "Register" state is based on the base state. All states are based on the base state by default so you can leave out the basedOn property. --> <mx:State name="Register" basedOn="">
<!-- Add a FormItem component to the form. --> <mx:AddChild relativeTo="{loginForm}" position="lastChild" creationPolicy="all" >
<mx:ControlBar> <!-- Use the LinkButton control to change to the Register view state. --> <mx:LinkButton label="Need to Register?" id="registerLink" click="currentState=Register" />