This code simulates traveling through a tunnel.
This is a very early work I did (I had known flash for maybe only a month at the time). Since then I have reduced the code from around 50 lines to 25 with a bit more knowledge on actionscript, I’m still an actionscript newbie.
Just posting for some feedback. Thanks.
df = 1.015;
_root.onEnterFrame = function() {
createIter = function() {
i = 200;
x=y=550;
xi = -2;
yi = -5;
var iter = _root.createEmptyMovieClip("iteration", 1);
with (iter) {
lineStyle(1, 0xFF0000, 100);
moveTo(x+50,y+100);
while(i > 0) {
lineTo((x/=xi)+50, y+100);
lineTo(x+50, (y/=yi)+100);
xi/=df;
yi/=df;
lineTo((x*=xi)+50, y+100);
lineTo(x+50, (y*=yi)+100);
xi*=df;
yi*=df;
i--;
}
}
iteration._x = 150;
df -= .0001;
}
createIter();
iteration._alpha = (df-1)/.000045;
};