events flashbuilder

where do i add in the event code for the button.
I have a mobile flashbuilder project and want to add code where click a button and display "hello world"
in textbox.
I want to use AS3 listener events like

 http://www.roseindia.net/flex/add-event-listener.shtml

this code goes where    <mx:Script><![CDATA[ ....
<?xml version="1.0" encoding="utf-8"?>
<components:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
				 xmlns:s="library://ns.adobe.com/flex/spark" xmlns:components="spark.components.*" title="HomeView">
	<fx:Declarations>
		<!-- Place non-visual elements (e.g., services, value objects) here -->
	</fx:Declarations>
	
	<s:Button x="100" y="100" label="button">
		
	</s:Button>
	<s:TextInput>
		
	</s:TextInput>
</components:View>

Open in new window

jagguyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dgofmanCommented:
<?xml version="1.0" encoding="utf-8"?>
<components:View xmlns:fx="http://ns.adobe.com/mxml/2009"
                         xmlns:s="library://ns.adobe.com/flex/spark" xmlns:components="spark.components.*" title="HomeView">
      
      <fx:Script>
            <![CDATA[
                  protected function buttonClickHandler(event:MouseEvent):void
                  {
                        trace("Hello World!");
                  }
            ]]>
      </fx:Script>

      <s:Button x="100" y="100" label="button" click="buttonClickHandler(event)">
            
      </s:Button>
      <s:TextInput>
            
      </s:TextInput>
</components:View>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dgofmanCommented:
Actually

<?xml version="1.0" encoding="utf-8"?>
<components:View xmlns:fx="http://ns.adobe.com/mxml/2009"
                         xmlns:s="library://ns.adobe.com/flex/spark" xmlns:components="spark.components.*" title="HomeView">
      
      <fx:Script>
            <![CDATA[
                  protected function buttonClickHandler(event:MouseEvent):void
                  {
                        textInput.text = "Hello World!";
                  }
            ]]>
      </fx:Script>

      <s:Button x="100" y="100" label="button" click="buttonClickHandler(event)">
            
      </s:Button>
      <s:TextInput id="textInput"/>
</components:View>
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Flex

From novice to tech pro — start learning today.