 A Flash Developer Resource Site

# Thread: Simple Calculation (anyone know how)

1. ## Simple Calculation (anyone know how)

I have price * amount = total

amount is an input box

so the user can input any amount they require

press a button and it will work out the total

P = Price;
A = Amount;
the_total = P*A;
return the_total;
};
submit.onRelease = function() {
};

The above works

got that work working but i need lots of these, now am a bit stuck here is the code that does not work:

P = Price;
A = Amount;
P1 = Price1;
A1 = Amount1;
the_total = P*A;
the_total1 = P1*A1;
return the_total , the_total1;
};
submit.onRelease = function() {
};

As you can see I have more than one total to work out, does anyone know how to do this? if so please let me know.

I have also attached the .fla  Reply With Quote

2. ## Any One Needing A Count System Its Here

I FIXED THE PROBLEM MYSELF - AND HERE IS THE SOLUTION

Note you must publish the movuie to flash player 7 with actionscript 1.0 for it to work.

The program:

I have price * amount = total

amount is an input box

so the user can input any amount they require

press a button and it will work out the total

also there is another set underneath of an price*amount = total

when the button is pressed it works out both calculations

then adds the totals together to give a grand total with is displayed in a dynamic text box - any way here is the code - if anyone wants it:

make a button then add this script to it:

//
on (release) {
P = Number(Price);
A = Number(Amount);
Total = (P*A);
T = Total;
P1 = Number(Price1);
A1 = Number(Amount1);
Total1 = (P1*A1);
T1 = Total1;
GrandTotal = (T+T1);
}
//

make sure your text boxes match the code in the scipt or it won't box  Reply With Quote

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

 » Home » Movies » Tutorials » Submissions » Board » Links » Reviews » Feedback » Gallery » Fonts » The Lounge » Sound Loops » Sound FX » About FK » Sitemap 