PDA

View Full Version : dissolve



Neo-Geo
July 10th, 2003, 12:53 PM
does anyone know how to do the dissolve box effect using actionscript?
random box appear until the big box is full

i made this using frame by frame, but its kind of big in size compare if it can be done using AS.

Coppertop
July 10th, 2003, 05:04 PM
well, i'm not the greatest with actionscript, but i found something that might do a similar purpose. http://www.levitated.net/daily/levBoxFitting.html download the fla and play around with the action script till you get what you want

Booyaka
July 10th, 2003, 08:12 PM
umm. yea thers a what to do this
let me think im kind of new too flash
but
you could like Make an MC thats a square then link it for actionscripting
then like put a code in like this
(its not tested)

onEnterFrame=function(){
num++;
Mc=attachMovie("square","square"+num,num);
Mc._x=Math.round(Math.random()*boxwidth/squaresize)*squaresize;
Mc._y=Math.round(Math.random()*boxheight/squaresize)*squaresize;
/*boxwidth and height are the size of tha area you what to put your MC in and square size
is like the leangth of your square*/
};

umm you would also what to put some hittest function in there so the MC wont stack up on top of each other

Booyaka
July 10th, 2003, 08:17 PM
is this like sothing you wanted????

claudio
July 10th, 2003, 09:01 PM
Maybe this?
It draws a 10x10 squares board using a 20x20 square.
:-\

Booyaka
July 10th, 2003, 09:17 PM
thats preety much the same thing as mine but
you dont want to waste processing power by stacking
MC on top of each other i would help with that
,but im still trying to get a grasp of AS myself

claudio
July 10th, 2003, 09:24 PM
Originally posted by Booyaka
thats preety much the same thing as mine but
you dont want to waste processing power by stacking
MC on top of each other i would help with that
,but im still trying to get a grasp of AS myself I place 700 boxes on stage while yours uses 2200, and keeps looping.

:q: :q:

Booyaka
July 10th, 2003, 09:29 PM
hey i said it was preety much the same not exacttly

claudio
July 10th, 2003, 09:33 PM
I didnt get your "you dont want to waste processing power by stacking MC on top of each other", since im using only 700 boxes and yours is a never ending looping. I think mine is less precessor intensive. :-\
Im sure theres a better way to use less boxes, but right now im stucked.

Booyaka
July 10th, 2003, 09:36 PM
yours is less prcessor intensive
i agreee with that i lose you winn :A+:

Neo-Geo
July 11th, 2003, 03:02 AM
thanks.. both of you really helps me. there's no win or lose here. we learn from each other. i think the two files answered my question completely.
Thanks again!

another flashers might want to improve it

Booyaka
July 12th, 2003, 02:20 AM
hey i got some help (marshdabeachy helped me
on the bit-101 forums)
heres the code
slots = [];
for (var x=0; x<12; x++) {
for (var y=0; y<8; y++) {
slots.push({x:x, y:y});
}
}
depth = 0;
onEnterFrame=function(){
var toUse = Math.floor(Math.random()*slots.length);
var s = attachMovie("square", "square"+depth, depth);
s._alpha = 50;
s._x = slots[toUse].x*50;
s._y = slots[toUse].y*50;
slots.splice(toUse, 1);
depth++;
};