<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" xmlns:as="com.actionscript.states.*" xmlns:forms="com.actionscript.forms.*" viewSourceURL="srcview/index.html"> <mx:Script> <![CDATA[ public function showName():void { nameForm.currentState = ""; addressForm.currentState = "hide"; } public function showAddress():void { nameForm.currentState = "hide"; addressForm.currentState = ""; } ]]> </mx:Script> <forms:Form1 id="nameForm" /> <forms:Form2 id="addressForm" currentState="hide" /> <mx:HBox> <mx:Button label="Name" click="showName()" /> <mx:Button label="Address" click="showAddress()" /> </mx:HBox> </mx:Application>