Hi all,
I am a beginner actionscripter, i am trying to learn by analysing other peoples code.
Please can anyone help answer some questions about the following snipet of Actionscript so that i may understand it!!
Frame 1 the following variables are decleared
i = "1";
row = "1";
columns = "2";
tak = "1";
netak = "1";
column = "2";
Frame 2 the following code is placed:
column = columns;
row = netak;
while (Number(column)>Number(tak)) {
if (Number(row)<16 and Number(column)<43) {
duplicateMovieClip("c", "c" add i, 900-i);
setProperty("c" add i, _rotation, column*45);
setProperty("c" add i, _x, Number(column*5)+160);
setProperty("c" add i, _y, Number(row*5)+179);
}
row = Number(row)+1;
column = column-1;
i = Number(i)+1;
}
What i understand from this portion of the code is that new variables are declared, but why? They do not appear in the code after they are declared, i am confused what purpose they have. As when i take them out the effect does not work properly so they must have some function!.
I understand that the while statement specifies that the IF condition should run so long as the value of the variable ìcolumnî is greater than the value of the variable ìtakî. When will the condition be met so that the loop stops as the value of the variable ìtakî remains constant and the value of the variable ìcolumnî only decreases by 1 each loop if the condition in the IF statement is false?
Also when will th IF condition be false?
I am trying to figure out why the numbers 16 and 43 were used in the IF statement.
I know its a lot to ask, hope i have made myself understood, if anyone needs, i can email the fla that i am attempting to analyse.
A million thanks in advance
I am a beginner actionscripter, i am trying to learn by analysing other peoples code.
Please can anyone help answer some questions about the following snipet of Actionscript so that i may understand it!!
Frame 1 the following variables are decleared
i = "1";
row = "1";
columns = "2";
tak = "1";
netak = "1";
column = "2";
Frame 2 the following code is placed:
column = columns;
row = netak;
while (Number(column)>Number(tak)) {
if (Number(row)<16 and Number(column)<43) {
duplicateMovieClip("c", "c" add i, 900-i);
setProperty("c" add i, _rotation, column*45);
setProperty("c" add i, _x, Number(column*5)+160);
setProperty("c" add i, _y, Number(row*5)+179);
}
row = Number(row)+1;
column = column-1;
i = Number(i)+1;
}
What i understand from this portion of the code is that new variables are declared, but why? They do not appear in the code after they are declared, i am confused what purpose they have. As when i take them out the effect does not work properly so they must have some function!.
I understand that the while statement specifies that the IF condition should run so long as the value of the variable ìcolumnî is greater than the value of the variable ìtakî. When will the condition be met so that the loop stops as the value of the variable ìtakî remains constant and the value of the variable ìcolumnî only decreases by 1 each loop if the condition in the IF statement is false?
Also when will th IF condition be false?
I am trying to figure out why the numbers 16 and 43 were used in the IF statement.
I know its a lot to ask, hope i have made myself understood, if anyone needs, i can email the fla that i am attempting to analyse.
A million thanks in advance