Learn Flash: Matrix Special Effects

Home • Members Tutorials Forum iSnapChat Contact Us 

 


Flash Tutorials

   

Flash Tutorial - The Matrix Special Effects

 

Free Flash Tutorial


Step 10    <<   Previous      Intro   1   2   3   4   5   6   7   8   9   10    >>      

 

Step Ten: The ActionScript Explained - Frame 3 & Notes

gotoAndPlay(2);

This makes the above script loop so that the Play Head on the Main Stage continually goes back one space. Thus the script in Frame 2 is looped infinitely and Movie Clips are selected and played in a random order.


Illustration of ActionScript

Consider that we have reached the end of Frame 1 and all the Movie Clips have been duplicated and placed in appropriate positions. The spans array would have been filled with negative integers. Let us assume it has the following elements in it :

spans[]={-51,-118,-120,-173,-230,-83,-205,-207,-185,-210,-143,-11,-68,-73,-93,-126,-214,-83,-53,-144,-188,-65,-89,-55,-203,-26,-96,-204,-52,-168}

Note: The magnitude alone of all the elements are below 240.

When the for loop is completely executed once, x would have taken the value from 0 to 29. The corresponding changes are tabulated below.

x spans[x] n=spans[x] * SSX + x spans[x]++
0 -51 -1530 -50
1 -118 -3539 -117
2 -120 -3838 -119
3 -173 -5187 -172
4 -230 -6896 -229
5 -83 -2485 -82
6 -205 -6144 -204
7 -207 -6203 -206
8 -185 -5542 -184
9 -210 -6291 -209
10 -143 -4280 -142
11 -11 -319 -10
12 -68 -2028 -67
.. .. .. ..
.. .. .. ..
.. .. .. ..
25 -26 -755 -25
26 -96 -2854 -95
27 -204 -6093 -203
28 -52 -1532 -51
29 -168 -5011 -167

It is clear from the above table that spans[11] will first become positive. At this time the value of n would be 11. So the Movie Clip c11 will be played. The x and y co-ordinates of this Movie Clip would be (x=360, y=0) on the screen (the point (0, 0) is the top left corner in the screen). In the following loops Movie Clips c41 (360, 25), c71 (360, 50), c101 (360, 75), c131 (360, 100).... etc in the same column (as x-coordinate remains the same) are played. In the interval between two successive clips being played, the variable x in the loop cycles through other values and Movie Clips in other columns may be played to create the special effects.

End of the Tutorial

I hope this tutorial will have helped you to create the Matrix special effects background. When you use your Movie Clips with this background be sure to set the depth of your Movie Clip at a suitable value so that it appears before the falling letters and not behind them. And remember to use normal fonts so that all the numbers from 0 to 255 have a corresponding character.

I hope you have found this useful. If so perhaps you could recommend this site to others and link to webwasp!

 

Please indicate what you thought of this tutorial 
10 is the best: 
10 9 8 7 6 5 4 3 2 1

         

Step 10    <<   Previous      Intro   1   2   3   4   5   6   7   8   9   10    >>      


50835 visitors to this page since 11 May 07 •

Phil Schulz's Facebook Profile
Webwasp is Phil Schulz's baby. You are welcome to contact me or become my Facebook friend: Click here

 Top of Page HomeMembers Tutorials Forum iSnapChat Contact Us 
 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.