I am looking for tool or any code which execute a segment of code for number of time until condition is true. I have lot of data and i wnat to run that data in to number of loop, can nay one provide me the code for Flash ActionScript loops.
I am looking for tool or any code which execute a segment of code for number of time until condition is true. I have lot of data and i wnat to run that data in to number of loop, can nay one provide me the code for Flash ActionScript loops.
The syntax for creating loops in ActionScript is a little more complex than the simple if statement. ActionScript loops are tools used to execute a segment of code repeatedly for a number of times or while a certain condition is satisfied.For-each-in is quite a secret looping method in ActionScript. This can save time and effort by not having to type the same code multiple times to repeat a process.
There are three main types of ActionScript loops, the for loop, the while loop, and the do-while loop.Code blocks are also used within if/else statements if multiple statements are to be carried when a given condition is true or false The for and while loops do exactly the same thing but with different syntax, the do-while loop differs in one small aspect.
Code:function chArr(arrayc:Array, arrayd:Array):void { for(var g=0, k=0; (g<arrayc.length-1) || (j<arrayd.length-1); g++, jk++) { if(arrayc[g]==arrayd[j]){ trace("elements c["+g+"] and d["+k+"] are equal!"); trace("element value is : "+arrayc[g]); } } trace("process finished."); } checkArrays(c, d);
Bookmarks