PDA

View Full Version : snow 2.0 + scriptable masks (make each flake a mask)



polishbroadcast
March 15th, 2005, 04:34 PM
I would like to combine the scriptable mask and snow tutorials so that each snowflake movieclip that gets duplicated, gets the same mask applied. ie. the end result is where there is a snowflake there is a clear image, and where there is no flake there is a blurred image.

I can get it to where the first flake that is duplicated gets the correct mask, but the other 59 don't get masks.

applying:
onClipEvent (load) {
_root.back.setmask(this);
}to the snow movieclip only makes one mask on the first instance. I have tried running that set mask in the do/while loop and also tried enclosing the clip it its own MC but it only makes one mask. Can i pull the mask dynamically from the library? Am i not assigning the setmask dynamically?

Thanks!

icio
March 15th, 2005, 06:00 PM
setMask(); // is the function you're after:thumb:

polishbroadcast
March 15th, 2005, 06:09 PM
That's what i'm using. It works for one of the particles but not for all the ones that are duplicated after that. Even changing setmask(); to setMask(); gives the same result. I've attached the FLA.

Ordinathorreur
March 15th, 2005, 06:18 PM
you can only use one mask for each MC, you will have to duplicate your "background" as well as your clips...

polishbroadcast
March 15th, 2005, 09:30 PM
Hopefully this is just my lack of knowing how to duplicate clips, but i'm still having problems getting the masks into multiple clips.

Here is what i have so far:
snowflakes = 20;
v = 100;
do {

duplicateMovieClip(snow, "snow"+k, k);
//duplicateMovieClip(_root.back, "back"+v, v);
k++;
v++;
backV="back"+v;
snowK="snow"+k;

this.attachMovie("back", "back"+v, v)
backV.setMask(_root.flur.snowK);

} while (k != snowflakes);

Ordinathorreur
March 16th, 2005, 05:46 AM
I don't have too much time on my hands so I'll point you in the right direction.

Create a movieclip that holds two objects, lets call it mainMovieMC.
MainMovieMC holds your background and your snowflake. Put an on(enterframe) function on your snowflakeMC to make it fall. Put an on(load) action on your backgroundMC that sets this.setmask(_parent.snowflake)
Now duplicate your mainMovieMC using a "for" loop.
If I have some time tomorrow I might be able to tinker with your .fla....

polishbroadcast
March 16th, 2005, 10:50 PM
I don't have too much time on my hands so I'll point you in the right direction.

Create a movieclip that holds two objects, lets call it mainMovieMC.
MainMovieMC holds your background and your snowflake. Put an on(enterframe) function on your snowflakeMC to make it fall. Put an on(load) action on your backgroundMC that sets this.setmask(_parent.snowflake)
Now duplicate your mainMovieMC using a "for" loop.
If I have some time tomorrow I might be able to tinker with your .fla....Thanks much. I appreciate the direction. I sorta understand most of it and hopefully i can work it out. I tried enclosing everything in an additional MC but i had the same issue, but the for loop might be the key.

polishbroadcast
March 16th, 2005, 11:27 PM
Eureka! Thanks for the advice. The "for" loop was the key. I don't understand why the "do/while" wasn't just duplicating what was in that clip, perhaps someone can enlighten me?

Anyhow, for anyone that wants to try this funness at home i've attached the FLA. It is a pretty nice effect. I replaced the images with really small ones so that it would be under 70k. Just put the blurry (or whatever) image on the stage at 0,0 and change the clear one in the library.

Thanks for the help everyone!

Ordinathorreur
March 17th, 2005, 06:20 AM
Nice... :beam: