[MX] Ilyas's Matrix Code Effect in a MovieClip

I am trying to make a matrix code effect inside a movieclip called “Code”, I am using the code made by Ilyas but have so far been unsucsessful, I can get it to work in the main root of a seperate .swf but not in the root of my main movie or a movieclip inside the root. I dont know how to alter it top make it work for a movieclip? Any suggestions? If you dont know the code I am talking about see below :

[AS]

/***Author: Ilyas USAL (pom)
Title: The Matrix has you…
Date: 06/06/2003
Version: 2 – Japanese characters, and it fades from white to green
***/
// To make it run smoother
_quality = “MEDIUM”;

// String containing all the characters available in the font
letters_str = “abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz” ;
length_num = letters_str.length ;

// Create a new trail every 100 milliseconds
setInterval(this,“createTrail”,10);

/*** Functions ***/
// fade out and remove clip when _alpha inferior to 10 - no parameters
function fadeToBlack(){
this._alpha -= 5;
if (this._alpha < 10){
delete this.onEnterFrame;
this.removeMovieClip();
}
};
// color fade from white to the original color
function whiteToGreen(){
this._alpha -= 3;
if (this.rb < 2 && this.gb < 2 && this.bb < 2){
this.rb = this.gb = this.bb = 0;
delete this.onEnterFrame;
}
else {
this.rb *= .9;
this.gb *= .9;
this.bb *= .9;
}
var trans = {rb:this.rb , gb:this.gb , bb:this.bb};
this.col.setTransform(trans);
};
// Create a new clip with a letter in it
// x: _x position ; y: _y position ; size: size of the letter
MovieClip.prototype.createLetter = function (x,y,size){
// Create and position the new clip
var mc = this.createEmptyMovieClip(“letter”+this.dep,this.dep++);
mc._x = x;
mc._y = y;
// Create a new TextField in the clip
mc.createTextField(“t”,0,0,0,size,size);
// Choose a random letter
var myChar = letters_str.charAt(random(length_num));
mc.t.text = myChar;
// Create the TextFormat, format the text and embed the font
var tf = new TextFormat();
tf.size = size;
tf.font = “Font1”;
tf.selectable = false;
tf.color = “0x00ff00”;
mc.t.setTextFormat(tf);
mc.t.embedFonts = true;
// Letter goes from white to green
mc.rb = mc.gb = mc.bb = 255;
mc.col = new Color (mc) ;
mc.col.setTransform({rb:255 , gb:255 , bb:255});
mc.onEnterFrame = whiteToGreen;
};
// Create a trail of letters
function createTrail(){
// Create new clip and position it randomly
var clip = this.createEmptyMovieClip(“trail”+i,i++);
clip._x = Math.round(random(Stage.width)/10)*10;
clip._y = clip.y = -10;
// Choose a random size for the letters, and set the spacing
var size = random(10)+15;
clip.spacing = size ;
// onEnterFrame, create a new letter that will wade out.
// if we’re at the bottom of the screen, fade out the whole trail
clip.onEnterFrame = function(){
this.y += this.spacing;
this.createLetter(0,this.y,size);
if (this.y > Stage.height) this.onEnterFrame = fadeToBlack;
};
};
[/AS]

Make sure you give a linkage identifier to the font in the library.

Ooops I had an i dentifyer before Trace Bitmaping my logo into the .swf and crashing my PC ,well it works now, thanks!

No problem :slight_smile:

That effect is too processor intensive for regular use, so if you are using it in a layout or something, I definitely don’t recommend that.

I agree Im only using it for a few seconds until the words “The Matrix” mask in. I am also using a setInterval of 150 so there arent that many trails on the screen at once.

[Offtopic]

This is probabily an insane question but is there anyway to recreate the Matrix Reloaded code effect at the beggining in AS or would that take hundreds of tweens?

[/Offtopic]

My advice: forget it!! :stuck_out_tongue:

*Originally posted by Keith130 *
**[Offtopic]

This is probabily an insane question but is there anyway to recreate the Matrix Reloaded code effect at the beggining in AS or would that take hundreds of tweens?

[/Offtopic] **
yeah…i’m sure it can be done :whistle:

:bad:

What wrong with you Ilyas?

whats the new matrix reloaded code effect like? isn’t it similiar?

Yeh its similar exsept is code made of code made of code…

It sort of zooms out from the smallest code to the one that is made of that code and so on.

*Originally posted by Keith130 *
**What wrong with you Ilyas? **
Nothing :stuck_out_tongue:

What was the grr face thing for then?

I believe it was kind of an “i dare you” gesture.

Yeh that will be the day when I create some advanced actionscript I just marvel the how people know all the stuff they do and lamly try to make something I am happy with, no I will leave some Matrix Coding to someone who knows what they are doing.