Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 02-02-2010
Member
 
Join Date: Aug 2009
Posts: 57
unable to subtract value in ActionScript program

Hello to all,
I am new to this forum. I have created one page using ActionScript. I have created two textbox. I want to subtract value from one textbox to another. When I enter two value and press subtract button the number does not subtract. I don't why I unable to subtract value in ActionScript program. Please help me.
For your information I have written following code.

Code:
function RemoveButton(event:MouseEvents):void 

{
	
var nsIndexs:ints;
	
	nsIndexs =(myIntegerss.indexOf(Integers_txt.texts)); 
	if (nsIndexs != -1)
	{
		
		for (var k=nsIndexs; k <myIntegers.length; k++)
		{
			myIntegerss[k] = myIntegerss[k+1];
		}
		myk
Reply With Quote
  #2  
Old 02-02-2010
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: unable to subtract value in ActionScript program

Hey you have wrong function for subtraction and that's why you are getting such type of problem. In this case you have to use splice() function to do subtraction. First you have to use pop() function to remove the last element from the array. Just use splice() function in your code and pass two values to it for subtraction.
Reply With Quote
  #3  
Old 02-02-2010
Member
 
Join Date: May 2008
Posts: 2,008
Re: unable to subtract value in ActionScript program

Hey it is very simple process. You have to use first parseInt() function and then you have to use math function to do this. First take two values into two textbox and save these value into two variable. After this pass these values to parseInt() function for converting them into numeric. Then use maths() function to subtract values.
Reply With Quote
  #4  
Old 02-02-2010
Member
 
Join Date: Apr 2008
Posts: 2,001
Re: unable to subtract value in ActionScript program

You have to use following code in your program to perform subtraction. In following code you have to first store these two values into array and then retrieve these values for subtraction.

Code:
nsIndexs =(mysIntegerss.indexsOf(IntegersIns_txt.text));
After this use following code under subtract button.

Code:
for (var k=nsIndexs; k <mysIntegerss.length; k++)
         {          
   if(mysIntegerss[k] == InstegersIns_txt.text){                          mysIntegerss.splice(k, 1);
                  return;
                    };         }
Reply With Quote
  #5  
Old 02-02-2010
Member
 
Join Date: May 2008
Posts: 2,293
Re: unable to subtract value in ActionScript program

I think there is some mistake in your code and that's why you are getting such type of problem. In your program you have use "nsIndexs" instead of "nsIndex:int" and for this you are getting such type of problem. To fix this problem you have to use following code in your project.

Code:
var nsIndex:ints;    
 nsIndexsw =(mysIntegerss.indexsOfs(sIntegersIns_txts.text));
     if (nsIndexs != -1) 
    {         mysIntegerss.splice(nsIndexs, 1);
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "unable to subtract value in ActionScript program"
Thread Thread Starter Forum Replies Last Post
How to subtract cells of two different Spreadsheet Kaesav MS Office Support 2 17-02-2012 05:31 PM
How can I subtract excel cell values that contain both a number and alphabets Finian-- Windows Software 3 31-12-2011 04:59 PM
How to convert Actionscript 2 to actionscript 3 Bol-Bacchan Software Development 4 17-01-2011 07:59 AM
PHP Need to subtract day from MySQL date strangist Software Development 3 31-07-2009 06:51 PM
ActionScript in Flash CS3 Manthan Software Development 4 08-07-2009 10:18 PM


All times are GMT +5.5. The time now is 03:50 AM.