Results 1 to 5 of 5

Thread: unable to subtract value in ActionScript program

  1. #1
    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

  2. #2
    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.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    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.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    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;
                        };         }

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    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);

Similar Threads

  1. How to subtract cells of two different Spreadsheet
    By Kaesav in forum MS Office Support
    Replies: 2
    Last Post: 17-02-2012, 05:31 PM
  2. Replies: 3
    Last Post: 31-12-2011, 04:59 PM
  3. How to convert Actionscript 2 to actionscript 3
    By Bol-Bacchan in forum Software Development
    Replies: 4
    Last Post: 17-01-2011, 07:59 AM
  4. PHP Need to subtract day from MySQL date
    By strangist in forum Software Development
    Replies: 3
    Last Post: 31-07-2009, 06:51 PM
  5. ActionScript in Flash CS3
    By Manthan in forum Software Development
    Replies: 4
    Last Post: 08-07-2009, 10:18 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,751,412,212.64337 seconds with 16 queries