New Calculator Extension for Flash CS3
![]() |
Here we go again with another extension. This is a simple calculator that can come in handy when you’re trying to figure out positions and values and don’t want to leave the Flash IDE. I downloaded the calculator SWF from Actionscript.org and did a re-skinning job on it before packaging it as an extension. The original was coded in AS 1 by H.G. Arunkumar. I considered porting it to AS 3 but half way through it I realized that it would be a complete waste of my time. Flash 5 SWF files still run great in Flash 9.
Follow the steps below to try it out:
Let me know if you find any bugs with it. You can also leave a comment here if you think you have an idea how to make it better. Thanks, |




i have to say, at first i was like why wouldn’t you just use your calculator (which i have on my dock). Then I tried it, and i realize losing focus and having to go back and forth is a real pain. It’s cool it accepts keyboard entries – at first i thought it was mouse only. Anyway, nice job.
[...] http://theflashblog.com/?p=343 Flash CS3 ??????. [...]
[...] Calculator, es una extensión para Adobe Flash CS3 que te permitirá tener una calculadora en la interfaz de trabajo de Flash. La extensión fue desarrollada por Lee Brimelow autor del sitio TheFlashBlog un sitio con muy buena información para desarrolladores Flash. [...]
I added up 5 and 6 and it gave me 11?
is this right?
OMG THANK YOU!!!
Lee – have you seen the new AIR Essential Training on lynda.com? Having to pay Verisign (the biggest rip-off artists in the world) so that you’re users don’t get put off is definitely the biggest problem with AIR, as well as the “UNRESTRICTED” for system access. What do people expect when installing an application? Surely Adobe can do better than this.
nice, but I olso think I’m gonna keep using my regular calculator
some functions like square, square roots and some variables would be usefull… (I don’t know as1 so I can’t add them)
maybe if somewone adds some cool futures it will be usefull..
but anyway, keep up the good work lee :p (love the snipets panel)
I see that there’s a fly-away menu at the top there. Is it possible to include items in that menu or is it system only?
Some more advanced functions might be nice too.
Cool extension, but I think I’ll still be sticking with the keyboard shortcut key for the calculator (from Logitech, on Vista).
Have you considered making an extension that can copy and paste position, width, height, alpha, rotation, (etc) values from and to other objects on the stage? That would be pretty neat, but is it possible? Perhaps you can also make check boxes for which values to paste
Check out a tool I made. It is a work timer, so u’ll be able to track the time of your development directly in Flash. http://photomage.co.uk/tools/
These is not a coment si no que una pregunta como se hace el reflexion in actionscritp 3.0 porke no puedo hacerlo como tus tutoriales que hacias en 2.0 el ejemplo de carrusel
El flash dice que ya no soporta ese codigo de reflexion
He read my mind. I work with Windows Vista on my Mac (had no choice all my software was windows before) i hate opening and closing my cal to do some simple sh?t. and it hit me, this might be better than the tweening thingy. good deal.
Is it possible to make ESCAPE clear the input field ?
Thanks for this BTW – it’s a great idea
The calculator.swf works in Fireworks too, nice.
Just drop it into:
Adobe Fireworks CS3\Configuration\Command Panels folder
Run fireworks and go to Window > Calculator and now you have a calculator that runs across commonly used apps, sweet!
Hi!
There is a little bug : if you type a big number (like 2.31635465135634e+17), and then press on the C button, 0 isn’t on the right side of the display screen no more.
Cheers
On Danish keyboards (and maybe all non-american keyboards) the “.” on the numeric keyboard doesn’t work in the calculator because Flash reads it as a “,”
I know you can’t change that but could you release the .fla for the calculator so we could change these small annoyances ourselves.
I know I could download the .fla you did but you did a such a good skinning job
)
[...] lommeregneren er lavet af Lee Brimelow og kan hentes her: [...]
[...] Components Free components can make life easier. I use the components from TheFlashBlog: Snippets Panel: http://theflashblog.com/?p=336 Event Generator: http://theflashblog.com/?p=331 calculator: http://theflashblog.com/?p=343 [...]
I do not believe this
I can not open a fla. file because “the following javascript errors occurred: in file ObjectFindAndSelect.jsfl cannot find file file:////users?mschafe/documents/proj2trial.fla. Do you happen to know what this means and is it possible to still open the file?
Hi Lee, great blog! I just wanted to mention that if you do decide to do a calculator, one I did a few years ago used a “calculate a string” method, where any string inputted to the method would result in a numeric value. If you did one this way, people could just type in the values and hit “calculate” instead of having to mouse click every number button which is a pain.
Here is the script from ‘05(messy but it worked)
function evaluateAString(evalString) {
//——-This bit of code will break any string of arithmetic down to a solution
//——-returning a real number solving in the order of “multiply divide add subract”.
//——-This was to compensate for the fact that the Eval statement in flash doesnt
//——-do this (as it does in many other languages). The function will not handle
//——-parenthesis, perhaps in a later version if I get any requests.
//——-Created by Ryan Cameron http://www.northeastmagic.com ryan@northeastmagic.com
//——-Have fun, modify at will! I did this quickly to solve an immediate issue,
//——-so Im aware its clunky, but it seems to do the trick, if there is a bug please let me know.
temp_math_array = new Array();
var tempHolder = “”;
var temp_math_arrayCount = 0;
for (var u = 0; u1) {
maxCount++;
if (numArrayCount>=Number(temp_math_array.length)) {
numArrayCount = 0;
}
prev = Number(numArrayCount-1);
post = Number(numArrayCount+1);
divideEnabled = true;
plusEnabled = true;
minusEnabled = true;
for (var inCount = 0; inCount<temp_math_array.length; inCount++) {
if (temp_math_array[inCount] eq “*”) {
divideEnabled = false;
plusEnabled = false;
minusEnabled = false;
}
if (temp_math_array[inCount] eq “/”) {
plusEnabled = false;
minusEnabled = false;
}
if (temp_math_array[inCount] eq “+”) {
minusEnabled = false;
}
}
switch (temp_math_array[numArrayCount]) {
case “+” :
if (plusEnabled) {
temp_math_array[prev] = Number(Number(temp_math_array[prev])+Number(temp_math_array[post]));
temp_math_array.splice(numArrayCount, 2);
}
break;
case “-” :
if (minusEnabled) {
temp_math_array[prev] = Number(temp_math_array[prev]-temp_math_array[post]);
temp_math_array.splice(numArrayCount, 2);
}
break;
case “*” :
temp_math_array[prev] = temp_math_array[prev]*temp_math_array[post];
temp_math_array.splice(numArrayCount, 2);
break;
case “/” :
if (divideEnabled) {
temp_math_array[prev] = Number(temp_math_array[prev])/Number(temp_math_array[post]);
temp_math_array.splice(numArrayCount, 2);
}
break;
default :
break;
}
numArrayCount++;
}
return (Number(temp_math_array.join(“”)));
}
Cheers,
Ryan Cameron