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]