PDA

View Full Version : fading grids


icio
01-17-2005, 02:07 PM
here's an effect i made that is to do with fading grids - hopefully this will help someone. i know there's a lot of people wondering how to code this.

i made the code very easy to adapt for yourself to use so please enjoy :) here is a basic example of one:

height= 600 width=400


here's some replacement functions. they're the first ones that i made. not nearly as nice, but you can have a look:
MovieClip.prototype.createGrid = function(x1:Number, x2:Number, y1:Number, y2:Number) {
x = x1;
y = y1;
_root.handle.onEnterFrame = function() {
tile = _root.attachMovie("tile", "tile_"+x+"_"+y, objCount);
objCount++;
tile._x = x*width;
tile._y = y*height;
tile._alpha = 0;
tile.fadeIn();
//
x++;
if (x>x2) {
x = x1;
y++;
if (y>y2) {
delete _root.handle.onEnterFrame;
doneAction();
}
}
};
};
MovieClip.prototype.destroyGrid = function(x1:Number, x2:Number, y1:Number, y2:Number) {
x = x2;
y = y2;
_root.handle.onEnterFrame = function() {
tile = _root["tile_"+x+"_"+y];
tile.fadeOut();
x--;
if (x<x1) {
x = x2;
y--;
if (y<y1) {
delete _root.handle.onEnterFrame;
doneAction();
}
}
};
};

Neil
01-17-2005, 02:11 PM
CANT HANDLE THIS :pa: , this is 1337 !!!!!!!

CYBERATHELETE : http://img122.exs.cx/img122/4610/adore8bk.gif

=) will take a month of digest this ;)

icio
01-17-2005, 02:20 PM
you're such an a$s kisser ;) lmao. but thank you :thumb:

Napoly
01-17-2005, 02:53 PM
dude.. that's awesome.. you helped me so much..

Neil
01-17-2005, 03:37 PM
you're such an a$s kisser ;) lmao. but thank you :thumb:

:lol: *** kisser ? :gas: :x :{

Mik3
01-17-2005, 04:35 PM
LEEB

icio
01-17-2005, 06:24 PM
LEEB
LEEB? :puzzle:

jerez_z
01-26-2005, 02:33 AM
what the hell is leeb?

Way to make me laugh, by the way

Neil
01-30-2005, 11:17 PM
Can you make a masking effect of the same kind ? :(

icio
01-31-2005, 01:17 PM
not at the moment - pc is knackered. the method you would use, however would be something like this:

replace the prototype that fades in the squares with one that with scale them in.
use setMask() to set them as a mask for a large movieclip that will cover the content you would like to mask in.

that's pretty much it - easy stuff.

billystar
02-01-2005, 07:44 AM
that is so cool!! would make a great preloadder for images.... gonna try and get my head around it :)