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

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

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.

Comments:0