How to create simple Calculator in Flash ( Actionscript 3 )

Create buttons and text fields as created above. give them instance name and change its type. Write down this code in action panel . And run it ( Crlt  + Enter ).  as mentioned in picture. Explanation of code: num1.restrict=”0-9″ num2.restrict=”0-9″ // so that user can only type numbers in text box. cal.addEventListener(MouseEvent.CLICK, result_); // … More How to create simple Calculator in Flash ( Actionscript 3 )

Rate this:

Get Biggest Number in Array ( Actionscript 3 )

//get biggest number………… // define array and number var avg:Array=new Array(1,5,8,9, 43,56,88,54,67,90,66,45); // define where big number holder var bigno:uint=0; // define result var res:uint; // for loop repeat action for(var i:uint=0; i<avg.length; i++){ // condition if 0 is less than avg[i], then bigno  equal to avg[i] if(  bigno<avg[i] ){ bigno=avg[i] } } //finally trace … More Get Biggest Number in Array ( Actionscript 3 )

Rate this:

Average in Actionscript 3

// define array var avg:Array=new Array(13,24,35,46,21,34,78,96,56,78,90,65,43); // define bigno to hold biggest number var bigno:uint=0; // define a variable to hold sum of array var res:uint; //for loop to repeat actions and get sum of array. for(var i:uint=0; i<avg.length; i++){ //condition for bigno, if bigno is smaller than number in array. if(bigno<avg[i] || bigno>0){ // … More Average in Actionscript 3

Rate this: