# Variables

**URL:** <https://forum.kirupa.com/t/variables/219124>\
**Category:** Uncategorized\
**Created:** [March 14, 2007, 2:04am UTC](https://forum.kirupa.com/t/variables/219124 "2007-03-14T02:04:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DG0](https://avatars.discourse-cdn.com/v4/letter/d/57b2e6/32.png) [@DG0](https://forum.kirupa.com/u/DG0)\
**Post date:** [March 14, 2007, 2:04am UTC](https://forum.kirupa.com/t/variables/219124/1 "2007-03-14T02:04:04Z")

</div>

Hi. I was pretty done with one of my projects in flash and then a good old Hard Drive wipe…  
The only thing I didn’t lose was my .swf file which I protected and even though I can import it, it doesn’t show any AS, just basic images etc.

I’m starting from scratch since I need to update it, and without the .fla file I can’t really  
do much of anything, but I was really working using the same formula… which I can’t seem to remember…

Basically what I’m trying to get at is:  
(This is just an example of something bigger and I’m just trying to keep it simple)

|Input Box “A”| |Input Box “B”|  
|Static Box “C”|  
|Button “whatever”|

I need button “whatever” to calculate formula relating box “A” & “B”.

I have tried just about every single combination and either I receive a “NaN” or nothing  
happens.

Code is something like:

on (click){  
C = Number(A)+Number(B);  
}

As for the onMouseDown or click it really doesn’t matter for me, but what I can’t seem to  
get working is the interaction between box “A” and “B”.

Say “A” = 1 and “B” = 2, it should make “C” = 3 right?  
Please post if you know anything about variables and numbers-- Thank you.
