|
||||||
|
||||||
Flash Tutorial - The Matrix Special Effects
Free
Flash Tutorial
Step Seven: The ActionScript
var SSX = 30;
var SSY = 30;
var XSPACING = 20;
var YSPACING = 20;
var spans = new Array(SSX);
for (y=0; y < SSY; y++) {
for (x=0; x < SSY; x++) {
var n = y * SSX + x;
if ((((x*5 ^ y*3)) & 3) == 0) {
duplicateMovieClip("myCharacters", "c"+n, n);/* Only add the following code (by removing the "//") if you have created individual MCs for specific letters such as A, B, C & D etc. Note the first Instance Name would go in the line above instead of: myCharacters The rest of the go in the lines below. Change my Instance Names to match yours. */
// } else if ((((x*5 ^ y*3)) & 4) == 0) {
// duplicateMovieClip("myMC_B", "c"+n, n);/* If you have more MCs, repeat the two lines of code as necessary incrementing the count like this: */
// } else if ((((x*5 ^ y*3)) & 5) == 0) {
// duplicateMovieClip("myMC_C", "c"+n, n);
/* Your very last MCs Instance Name would go in the line below instead of: myCharacters */} else {
duplicateMovieClip("myCharacters", "c"+n, n);
}
with (this["c"+n]) {
_x = x*XSPACING+XSPACING;
_y = y*YSPACING;
}
}
}
for (x=0; x<SSX; x++) {
y = Math.random()*SSY*8;
spans[x] = -(int(y));
}
for (x=0; x<SSX; x++) {
if (spans(x)>=0) {
n = spans[x]*SSX+x;
this["c"+n].gotoAndPlay(2);
if (spans[x]>=SSY) {
n = Math.random()*SSY*8;
n = int(n);
spans[x] = -n;
}
}
spans[x]++;
}
gotoAndPlay(2);
Your Movie is done! In the next section the ActionScript is explained.
|
Why not try out webwasp's new community. Meet new people, find friends in your area: Webwasp Mates & Dates
•
17750 visitors to this page since
11 May 07 •
|
|
|
All material on this site is protected under international copyright © law. DO NOT reproduce any material from this site without written permission. Please ask as permission is often granted.
|