Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Flex Change the text of a button whenever you clicked

Related Tutorials


 
 

Share on Google+Share on Google+

Change the text of a button whenever you clicked

Advertisement
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>


  

 

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: February 16, 2005

Related Tutorials

Discuss: Change the text of a button whenever you clicked  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com