hi i am learning to create tiles and i am following oos.moxiecode tutorials… Here i am unable to understand the code for the scrolling function
http://oos.moxiecode.com/tut_04/index.html
[FONT=verdana,geneva,arial,helvetica][SIZE=-2][SIZE=2]// scroll-function
function doScroll (dir) {
// right
if ( dir == "right" && j <= mapW ) {
this.scrClip._x -= scrSpeed;
majorX += scrSpeed;
if ( majorX >= tileW ) {
for ( var lasti=(i-visAreaY); lasti < i; ++lasti ) {
for ( var lastj=j; lastj < (j+1); ++lastj ) {
this.scrClip.attachMovie("tile", "t_"+lasti+"_"+lastj, ++d);
this.scrClip["t_"+lasti+"_"+lastj]._x = lastj*tileW;
this.scrClip["t_"+lasti+"_"+lastj]._y = lasti*tileH;
this.scrClip["t_"+lasti+"_"+lastj].gotoAndStop ( map1[lasti][lastj][0] );
removeMovieClip ( this.scrClip["t_"+lasti+"_"+(lastj-visAreaX-1)] );
}
}
++j;
majorX -= tileW;
}
}
}
[/SIZE][/SIZE][/FONT]
I don’t understand how he calculates the variable lasti(the logic too) and lastj in the for loops and incrementing the j variable and also the removeMovieClip code…can anybody explain and help me understand it better…