ActionScript Calculator Part 4: Declaring Variables and Button Array

Tue, Sep 15, 2009

ActionScript, Adobe Flash



Click here for part 5

Now with the calculator design completed, we are ready to move on and start coding. The variables first!

Click here to see the calculator completed, fully functional deployed on Widgetbox performing page views and downloads

Click here for the Final, Completed, Flash CS4 Source Code

HERE IS THE SOURCE CODE!

//The ActionScript 3.0 Calculator Variables
// solutions at say-web dot com
// FREE to USE, COPY and DISTRIBUTE

// Calculator Variables

/* This array handles the buttons
instance names */

var numbers:Array= [ num0_btn, num1_btn, num2_btn, num3_btn, num4_btn, num5_btn, num6_btn, num7_btn, num8_btn, num9_btn];

/* This array will handle the operation buttons.
the order is not important, the spelling must be
correct */

var operators :Array = [add_btn, subtract_btn, multiply_btn, divide_btn, equal_btn];

/* This variable handles the operation itself
(NOT the button) */

var op:String;

/* this will handle the first value
and the second */

var num1:Number;
var num2:Number;

Related Articles:

, , , , , , , , , , , , , , ,

2 Responses to “ActionScript Calculator Part 4: Declaring Variables and Button Array”


Trackbacks/Pingbacks

Leave a Reply

You must be logged in to post a comment.

My name is Avraham Saltoun, and I live in Jerusalem, Middle East. I am currently on my mid  40's and I am a computer programming technician. Here you will find over one hundred quality video tutorials on Actionscript, and yes, I give online support for aspiring programmers, and pros as well, sharing screen on skype and delivering source code by email, click the button for live flash actionscript support now!

 
oDesk Certified Action Script Programmer
oDesk Certified Adobe Flash CS3 Designer
oDesk Certified Adobe Photoshop 6.0 Designer
Skype Me™!

$7.49 .Com! Score Savings Cartoon Smart Tutorials


1,260
Unique Visitors
Previous 30 Days
Powered By Google Analytics