ahhh yes, good ol’ beginners calculator.

im very rusty with flash and i was kinda gettin back into it this evening and came up with this calculator.

i wasted a bunch of time trying to do some num/word thing and never figured it out. id like to ask the experts here to help me troubleshoot that.

anyway, heres the link to the .swf

lemme know what you think.

back to my question. at first i had a little trouble with the addition because i wasnt using the Number() thing but then i looked it up and etc etc, but anyway i wanted to have a variable called myType that would be set by 2 buttons to either “num” or “word”.

depending on which it was, num or word, the addition would be different.

if num, addition would use Number(), but if word, addition would just have num1+num2.

my code was this:

on (release) {
if(myType = “num”){
var out = Number(num1)+Number(num2);
if(myType = “word”){
var out = num1+num2;

i also tried it with an if/else thing. but nothing would work. for some reason when i pressed the + button it was changing myType variable…

it was thoroughly confusing to me, and i spent way to much time on it so i decided to leave that bit out.

if you are going to try to help me, and need a lil bit more info… ill be happy to provide it.


(myType = "word")
(myType = "num")

Is assigning that value to myType,

(myType == "num")
(myType == "word")

Is comparing it.
Open the reference window (Shift+F1) in flash(MX)& read through the “Operators” section. :smiley:

man, i was sure i tried that as well, and the debug game me a syntax error… ill try it again today.