Home Flex Change the text of a button whenever you clicked



Change the text of a button whenever you clicked
Posted on: February 16, 2005 at 12:00 AM
In the current tutorial we'll study that how to change the label of a button on clicking on itself. You can make a separate actionScript file, but in this tutorial that has been included in a single file.

Change the text of a button whenever you clicked

     

 

In the current tutorial we'll study that how to change the label of a button on clicking on itself. You can make a separate actionScript file, but in this tutorial that has been included in a single file.

 

 

 

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" >
<mx:Script>
<![CDATA[
public function changeText():void{
if(First.label=="Change")
First.label="Changed";
else
First.label="Change";
}
]]>
</mx:Script>
<mx:Button id="First" label="Change" click="changeText()"/>

</mx:Application>


  

 

Related Tags for Change the text of a button whenever you clicked:


More Tutorials from this section

Ask Questions?    Discuss: Change the text of a button whenever you clicked  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.