Pixel explosion

hi all,

this is of course for everyone, but I think “lostinbeta” would be the best to know… I dl’d his Pixel Explosion script from earlier…what I would like to to is, have a button that when “onClick” has the chracters explode…perhaps the npixel fadout etc.

Thoughts, Ideas?

thx,

m.

For the record:

Ilyas wrote the pixel explosion code. I modified it to get variations on the effect, and added those to the thread as a .zip file, but the original code came from Ilyas. Just wanna make sure that is clear, I don’t wanna take someone elses credit.

Secondly, it shouldn’t be too hard, but I can’t work on it right now, I will see if I can come up with something later.

Thanks lost :smiley: And for the record, Ferry Halim came up with the original effect. We call that giving back to Caesar what belongs to Caesar… :slight_smile:

And mucho, if you read (and understand) the code, you’ll see that there’s a function called clipOnRollOver or something like that. Just call that function onPress and everything is giong to explode :slight_smile:

thanks guys…(I’ll try)
and “biggy up massiv” for you people keeping the props.

thanks,

m.

Uhh, may I ask what “biggy up massiv” means :h:

Ilyas,
sorry to bug you with this… I did the changes, the single charcters do explode on click, but not the whole text… ???

m.

ps. biggy up massiv is the line that Ali G. uses, when he shows respect for someone… It is royally stupid…but funny :wink:

Here’s a modifcation I came up with real quick… [AS]cellSize = 2;
radius = 20;
damp = .9;
numLetter = 0;
letterSpacing = 12;
letterL = new Array(
[1, 0, 0, 0, 0],
[1, 0, 0, 0, 0],
[1, 0, 0, 0, 0],
[1, 0, 0, 0, 0],
[1, 1, 1, 1, 1]);
letterO = new Array(
[1, 1, 1, 1, 1],
[1, 0, 0, 0, 1],
[1, 0, 0, 0, 1],
[1, 0, 0, 0, 1],
[1, 1, 1, 1, 1]);
letterS = new Array(
[1, 1, 1, 1, 1],
[1, 0, 0, 0, 0],
[0, 1, 1, 1, 0],
[0, 0, 0, 0, 1],
[1, 1, 1, 1, 1]);
letterT = new Array(
[1, 1, 1, 1, 1],
[0, 0, 1, 0, 0],
[0, 0, 1, 0, 0],
[0, 0, 1, 0, 0],
[0, 0, 1, 0, 0]);
letterI = new Array(
[1, 1, 1, 1, 1],
[0, 0, 1, 0, 0],
[0, 0, 1, 0, 0],
[0, 0, 1, 0, 0],
[1, 1, 1, 1, 1]);
letterN = new Array(
[1, 0, 0, 0, 1],
[1, 1, 0, 0, 1],
[1, 0, 1, 0, 1],
[1, 0, 0, 1, 1],
[1, 0, 0, 0, 1]);
letterB = new Array(
[1, 1, 1, 1, 1],
[1, 0, 0, 0, 1],
[1, 1, 1, 1, 0],
[1, 0, 0, 0, 1],
[1, 1, 1, 1, 1]);
letterE = new Array(
[1, 1, 1, 1, 1],
[1, 0, 0, 0, 0],
[1, 1, 1, 0, 0],
[1, 0, 0, 0, 0],
[1, 1, 1, 1, 1]);
letterA = new Array(
[1, 1, 1, 1, 1],
[1, 0, 0, 0, 1],
[1, 1, 1, 1, 1],
[1, 0, 0, 0, 1],
[1, 0, 0, 0, 1]);
function containerPress() {
delete this.onPress;
for (var clip in this._parent) {
for (var clip2 in this._parent[clip]) {
this._parent[clip][clip2].explode();
}
}
}
function displayCell(letter) {
var num, i, j, mc;
clip = this.createEmptyMovieClip(“container”+numLetter, numLetter++);
clip._y = Stage.height/2;
clip._x = (numLetterletterSpacing)+(Stage.width/2.63);
clip.onPress = containerPress;
for (j=0; j<letter.length; j++) {
for (i=0; i<letter[0].length; i++) {
mc = clip.attachMovie(“cell”, “cell”+num, num);
mc.i=i, mc.j=j;
mc._x = i
cellSize;
mc._y = jcellSize;
num++;
myColored = new Color(mc);
letter[j]
== 1 ? myColored.setRGB(0x000000) : myColored.setRGB(0xE6E6E6);
}
}
}
MovieClip.prototype.explode = function() {
this.start = getTimer();
this.vx = (Math.random()-.5)*radius;
this.vy = (Math.random()-.5)*radius;
this.onEnterFrame = function() {
this._x += this.vx;
this._y += this.vy;
this.vx *= damp;
this.vy *= damp;
if (this._alpha>0) {
this._alpha -= 5;
} else {
delete this.onEnterFrame;
this.removeMovieClip();
}
};
};
displayCell(letterL);
displayCell(letterO);
displayCell(letterS);
displayCell(letterT);
displayCell(letterI);
displayCell(letterN);
displayCell(letterB);
displayCell(letterE);
displayCell(letterT);
displayCell(letterA);
[/AS]

And thanks for clearing up that “biggy up massiv” thing, I have honestly never heard that before :x

Ok, while I am at it, I will fix something that has been buggin me since day 1 (but back then I didn’t know enough to fix it and I haven’t touched it since.

Replace [AS]displayCell(letterL);
displayCell(letterO);
displayCell(letterS);
displayCell(letterT);
displayCell(letterI);
displayCell(letterN);
displayCell(letterB);
displayCell(letterE);
displayCell(letterT);
displayCell(letterA);[/AS] with [AS]wordToMake = “Lostinbeta”;
convertWord = wordToMake.toUpperCase().split("");
for (var i = 0; i<convertWord.length; i++) {
displayCell(this[“letter”+convertWord*]);
}
[/AS]

correction: WOWWW (capitalized) this is GREAT!

woww…that’s great, let me try it right away…
thanks a lot!
m.

ps. I have have question about preloading…(haha just kiddn)

A few notes:

I added the greyish tannish blocks in there (0xE6E6E6) so that you have a wider hit area instead of just the letters. You can change that color where 0xE6E6E6 is in the script to be the default background color. so you don’t see it, or you can just set the _alpha property of the clip to 0 instead (probably what I shoulda done in the first place).

The arrays will all have to begin with “letter”

letterA, letterB, letterC, etc.

Glad you like it, have fun, you should experiment and create a new variation :thumb:

this is great!

A greater Hit area makes a lot of sense, knowing the problem when the “HIT area” with usual text buttons is not set…

I’ll definitely experiment with it and let you guys know about it!

keep up the good work,

m.

biggy up massiv lol

HACTUALLY… I belief wut ee ment too say wuz: “Big IT up, massive”

but maybe that’s just my interpretation (of the situation).

That would make more sense, but either way it still makes no sense to me :stuck_out_tongue:

That’s nice! :slight_smile:

too bad Ali G doesnt seem to exist here in Japan… I’d go as far as renting one his movies again just to analyze this one again :slight_smile: although I’m quite sure I have a strong knowledgebase of Ali G quotes (inside my head :stuck_out_tongue: )to back this one up… :cool:

arf… enough with the offtopic anyway.

:love: Ilyas approved! :thumb:

i dont get it, wehre do u put the action script? on an object or on the 1st frame of a movie? :h: :h: :h:

hi,

i was wondering whether this pixel explosion script by LostinBeta is still on line? Was it a tutorial? I can’t find it but love to try it!

Thank you
Jerryj.

hey hey…how come there all silent like this…we need a little bit information here?..can someone help with this tutorial pleease