Monday 23 May 2016

FLASH 7 AS2 CALCULATOR

FLASH 7 AS2 CALCULATOR

-----------------------------------------------------------------------------------------------------------------
READ MORE:
http://www.erasme.org/libre/divers/animations/calculatrice.swf
calculatrice.swf
http://carremaths.yellis.net/321-fr-207.swf
http://dpernoux.free.fr/calculatrice_lycee.swf
-----------------------------------------------------------------------------------------------------------------
FLASH 7 AS2 CALCULATOR

-----------------------------------------------------------------------------------------------------------------
BT LAYER  FRAME CODES:
-----------------------------------------------------------------------------------------------------------------
//FRAME NO: 1 CODE
memory = 0;
sp = 0;
display = 0;
stop ();
-----------------------------------------------------------------------------------------------------------------
//FRAME NO: 2 CODE
if(clear == 1){
clear = 0;
decimal = 0;
display = 0;

if(display == 0 && digit != "."){
display = digit;
}
else{
display = display add digit;

-----------------------------------------------------------------------------------------------------------------
//FRAME NO: 3 CODE
if(operator eq "+"){
display = operand1 + display;

if(operator eq "-"){
display = operand1 - display;

if(operator eq "*"){
display = operand1 * display;

if(operator eq "/"){
display = operand1 / display;

operator = "=";
clear = 1;
decimal = 0;
-----------------------------------------------------------------------------------------------------------------
FIRST MAKE TEXT BOX AND PUT VARIABLES : display
BUTTON CODES
-----------------------------------------------------------------------------------------------------------------
//UNDER BUTTON M+ CODE
on(press){
memory = memory + display;
}
//UNDER BUTTON MRC CODE
on(press){
display = memory;
memory = 0;
clear = 1;
}
//UNDER BUTTON C CODE
on(press){
display = 0;
decimal = 0;
}
//UNDER BUTTON CE CODE
on(press){
operand1 = 0;
display = 0;
operator = "";
clear = 0;
decimal = "false";
}
//UNDER BUTTON 1 CODE
on(press){
digit = 1;
call("AddDigit");
}
//UNDER BUTTON 2 CODE
on(press){
digit = 2;
call("AddDigit");
}
//UNDER BUTTON 3 CODE
on(press){
digit = 3;
call("AddDigit");
}
//UNDER BUTTON DIVIDE CODE
on (press){
call("DoOperator");
operator = "/";
operand1 = display;
}
//UNDER BUTTON 4 CODE
on(press){
digit = 4;
call("AddDigit");
}
//UNDER BUTTON 5 CODE
on(press){
digit = 5;
call("AddDigit");
}
//UNDER BUTTON 6 CODE
on(press){
digit = 6;
call("AddDigit");
}
//UNDER BUTTON MULTIPLY CODE
on (press){
call("DoOperator");
operator = "*";
operand1 = display;
}
//UNDER BUTTON 7 CODE
on(press){
digit = 7;
call("AddDigit");
}
//UNDER BUTTON 8 CODE
on(press){
digit = 8;
call("AddDigit");
}
//UNDER BUTTON 9 CODE
on(press){
digit = 9;
call("AddDigit");
}
//UNDER BUTTON MINUS CODE
on (press){
call("DoOperator");
operator = "-";
operand1 = display;
}
//UNDER BUTTON 0 CODE
on(press){
digit = 0;
call("AddDigit");
}
//UNDER BUTTON DOT SIGN CODE
//PRESS C BUTTON THEN PRESS DOT BUTTON AND TYPE VALUE
// BECAUSE WITHOUT C BUTTON U CAN NOT TYPE DOT VALUE
on(press){
if(decimal == 0){
digit = ".";
call("AddDigit");
decimal = 1;
}
//UNDER BUTTON EQUAL CODE
on (press){
call("DoOperator");
}
//UNDER BUTTON PLUS CODE
on (press){
call("DoOperator");
operator = "+";
operand1 = display;
}




EmoticonEmoticon