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.

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

Ads

 

We have 1000s of tutorials on our website. Search Tutorials tutorials on our website.

Share on Google+Share on Google+

Change the text of a button whenever you clicked

Posted on: February 16, 2005 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

Ads
 

Discuss: Change the text of a button whenever you clicked  

Post your Comment


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

Ads

 

Ads