Monday, 18 April 2016

STRING COUNTER TYPER



---------------------------------------------------------------------------------------------------------------------
CODES:
http://help.adobe.com/en_US/as2/reference/flashlite/WS5b3ccc516d4fbf351e63e3d118ccf9c47f-7fd6.html
https://www.youtube.com/watch?v=oyH3IizahFU&feature=youtu.be
https://www.youtube.com/watch?v=H7IvquSlPOA
---------------------------------------------------------------------------------------------------------------------

var screen:String = "1";
Bn1.onPress=function(){
screen=screen+ 1;
Txt1.text =  screen
}
var screen:String = "1";
Bn1.onPress=function(){
screen++
Txt1.text =  screen
}
var Num1:String = "";
Bn1.onPress=function(){
Num1 = Num1 + "A";
Txt1.text =  Num1
}
//OUT PUT LIKE COUNTER
var Num1:String = "0";
Bn1.onPress=function(){
Num1++
Txt1.text =  Num1
}
var Num1:String = "10";
Bn1.onPress=function(){
Num1--
Txt1.text =  Num1
}
// A STEP TO CALCULATOR AS2
var Num1:String = "";
var Total:Number = 0;
Bn1.onPress=function(){
Num1 += "1"
Txt1.text =  Num1
}
Bn2.onPress=function(){
Num1 += "2"
Txt1.text =  Num1
}
EqualBtn.onPress=function(){
Total =  Number(Txt1.text) + Number(Txt1.text)
Txt1.text = Total;
}
ClearBtn.onPress=function(){
Txt1.text = "";
}

//AS3 CODE
var Num1:Number = 0;
CountBtn.addEventListener(MouseEvent.CLICK,AddOne);
function AddOne(e:MouseEvent):void{
Num1 = Num1 + 1;
trace(Num1);
}
//OUT PUT 11111111 LIKE COMPUTER KEYPAD
var Num1:String = "";
Bn1.onPress=function(){
Num1 = Num1 +1
Txt1.text =  Num1
}
//AS3 CODE
//I F VARIBLE LINE var Num1:Number = 0; INSIDE FUNCTION IT MAKE KEY PAD
CountBtn.addEventListener(MouseEvent.CLICK,Count);
function Count(event:MouseEvent):void{
var Num1:Number = 0;
Num1 = Num1 + 1
trace(Num1)
}
//OR USE AS3 CODE FOR KEY PAD
CountBtn.addEventListener(MouseEvent.CLICK,AddOne);
function AddOne(e:MouseEvent):void{
var Num1:Number = 1;
trace(Num1);
}







EmoticonEmoticon