# Multiple masking

**URL:** <https://forum.kirupa.com/t/multiple-masking/117998>\
**Category:** Uncategorized\
**Created:** [August 1, 2004, 9:44pm UTC](https://forum.kirupa.com/t/multiple-masking/117998 "2004-08-01T21:44:54Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![shani](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@shani](https://forum.kirupa.com/u/shani)\
**Post date:** [August 1, 2004, 9:44pm UTC](https://forum.kirupa.com/t/multiple-masking/117998/1 "2004-08-01T21:44:54Z")

</div>

hey all,  
im working on a flash project and i wanna use a whole bunch of rectangular boxes to show my background image. the image is suppose 2 be behind a darker rectangular box which is gonna be set on a different layer. basically, this is what i did.  
i had n image and i wanted to use the masking effect where a single line would go over a dark rectangle so that the fancy image i have can be seen in the normal way when you do the masking effect.  
but what im tryin to do is have a whole bunch of shapes doing stuff in random motion at the same time so that those shapes show the background image over the rectangular box like in the same way when you do masking. any suggestions?

---

<div class="post-metadata">

**Author:** ![stringy](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@stringy](https://forum.kirupa.com/u/stringy)\
**Post date:** [August 1, 2004, 10:24pm UTC](https://forum.kirupa.com/t/multiple-masking/117998/2 "2004-08-01T22:24:32Z")

</div>

> [@shani](#):
>
> hey all,  
> im working on a flash project and i wanna use a whole bunch of rectangular boxes to show my background image. the image is suppose 2 be behind a darker rectangular box which is gonna be set on a different layer. basically, this is what i did.  
> i had n image and i wanted to use the masking effect where a single line would go over a dark rectangle so that the fancy image i have can be seen in the normal way when you do the masking effect.  
> but what im tryin to do is have a whole bunch of shapes doing stuff in random motion at the same time so that those shapes show the background image over the rectangular box like in the same way when you do masking. any suggestions?

put them all in a movieclip and use that to mask

---

<div class="post-metadata">

**Author:** ![shani](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@shani](https://forum.kirupa.com/u/shani)\
**Post date:** [August 2, 2004, 7:05am UTC](https://forum.kirupa.com/t/multiple-masking/117998/3 "2004-08-02T07:05:42Z")

</div>

> [@stringy](#):
>
> put them all in a movieclip and use that to mask

i did actually try that out. i had two different rectangles and i made them move about in different directions. yet, only the first rectangle could be seen.

---

<div class="post-metadata">

**Author:** ![stringy](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@stringy](https://forum.kirupa.com/u/stringy)\
**Post date:** [August 2, 2004, 2:09pm UTC](https://forum.kirupa.com/t/multiple-masking/117998/4 "2004-08-02T14:09:20Z")

</div>

> [@shani](#):
>
> i did actually try that out. i had two different rectangles and i made them move about in different directions. yet, only the first rectangle could be seen.

I`m not entirely clear as to what you are trying to do, have a look at this and see if its any help.

---

<div class="post-metadata">

**Author:** ![shani](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@shani](https://forum.kirupa.com/u/shani)\
**Post date:** [August 2, 2004, 7:51pm UTC](https://forum.kirupa.com/t/multiple-masking/117998/5 "2004-08-02T19:51:50Z")

</div>

tha was amazing. yup, im tryin to do pretty much tha, but what you did was have a whole bunch of the same type of boxes moving around in random motion. wha im tryin to do is hav 3 spheres (very small ones) which move abou independently. with tha, im also tryin to have a few horizontal and vertical rectangular bars which move abou. but those bars don keep moving abou unlike the spheres.  
how did u do that:h:? tha was sweeeet:thumb:

---

<div class="post-metadata">

**Author:** ![stringy](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@stringy](https://forum.kirupa.com/u/stringy)\
**Post date:** [August 2, 2004, 8:10pm UTC](https://forum.kirupa.com/t/multiple-masking/117998/6 "2004-08-02T20:10:58Z")

</div>

> [@shani](#):
>
> tha was amazing. yup, im tryin to do pretty much tha, but what you did was have a whole bunch of the same type of boxes moving around in random motion. wha im tryin to do is hav 3 spheres (very small ones) which move abou independently. with tha, im also tryin to have a few horizontal and vertical rectangular bars which move abou. but those bars don keep moving abou unlike the spheres.  
> how did u do that:h:? tha was sweeeet:thumb:

Convert you background image to a movieclip and give it an instance name of masked.  
press ctrl/f8 to create a new movieclip.  
on different layers tween your spheres and put your bars  
go back to the main timeline containing masked  
open the library and drag an instance of the symbol you have just created onto the stage.  
give it an instance name mask  
open the actions panel, click on the first frame and in the actions panel type  
masked.setMask(mask);

---

<div class="post-metadata">

**Author:** ![shani](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@shani](https://forum.kirupa.com/u/shani)\
**Post date:** [August 3, 2004, 8:17am UTC](https://forum.kirupa.com/t/multiple-masking/117998/7 "2004-08-03T08:17:21Z")

</div>

oh cool. i always thought there would be a code or something like it to make it move around randomly like in the snow effect illustrated in one of the kirupa tutorials…

---

<div class="post-metadata">

**Author:** ![stringy](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@stringy](https://forum.kirupa.com/u/stringy)\
**Post date:** [August 3, 2004, 12:31pm UTC](https://forum.kirupa.com/t/multiple-masking/117998/8 "2004-08-03T12:31:57Z")

</div>

The one i made does use some simple code, but I don`t think there is any need for you to, unless you want the spheres to move in a more random manner.

---

<div class="post-metadata">

**Author:** ![shani](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@shani](https://forum.kirupa.com/u/shani)\
**Post date:** [August 4, 2004, 12:39pm UTC](https://forum.kirupa.com/t/multiple-masking/117998/9 "2004-08-04T12:39:26Z")

</div>

> [@stringy](#):
>
> The one i made does use some simple code, but I don`t think there is any need for you to, unless you want the spheres to move in a more random manner.

well i dunt really mind if they could move abou on a vertical axsis in a random motion.

---

<div class="post-metadata">

**Author:** ![stringy](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@stringy](https://forum.kirupa.com/u/stringy)\
**Post date:** [August 4, 2004, 10:13pm UTC](https://forum.kirupa.com/t/multiple-masking/117998/10 "2004-08-04T22:13:37Z")

</div>

> [@shani](#):
>
> well i dunt really mind if they could move abou on a vertical axsis in a random motion.

so you just want a couple of spheres moving up and down and the speed varying from time to time?What about the bars, are the moving horizontally?  
maybe rotate 90 degrees if they hit the edge of the mask?

---

<div class="post-metadata">

**Author:** ![shani](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@shani](https://forum.kirupa.com/u/shani)\
**Post date:** [August 5, 2004, 7:50am UTC](https://forum.kirupa.com/t/multiple-masking/117998/11 "2004-08-05T07:50:34Z")

</div>

> [@stringy](#):
>
> so you just want a couple of spheres moving up and down and the speed varying from time to time?What about the bars, are the moving horizontally?  
> maybe rotate 90 degrees if they hit the edge of the mask?

well im not so sure about the bars right now cuz im still finishing up on the art work tha im gonna be using in the background. so far, im jus hoping maybe i could have some help with the spheres.

---

<div class="post-metadata">

**Author:** ![stringy](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@stringy](https://forum.kirupa.com/u/stringy)\
**Post date:** [August 5, 2004, 12:48pm UTC](https://forum.kirupa.com/t/multiple-masking/117998/12 "2004-08-05T12:48:40Z")

</div>

> [@shani](#):
>
> well im not so sure about the bars right now cuz im still finishing up on the art work tha im gonna be using in the background. so far, im jus hoping maybe i could have some help with the spheres.

This is the same file as i made earlier with horizontal velocity removed and the squares now spheres.

---

<div class="post-metadata">

**Author:** ![shani](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@shani](https://forum.kirupa.com/u/shani)\
**Post date:** [August 8, 2004, 6:19pm UTC](https://forum.kirupa.com/t/multiple-masking/117998/13 "2004-08-08T18:19:13Z")

</div>

tha was niceeeee… yea im tryin to do jus that. is there any way thaa there cud be like more circles 2 giv n aquarium effect. like u know, how the bubbles go up in an aquarium. tha was niceee:thumb:

---

<div class="post-metadata">

**Author:** ![stringy](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@stringy](https://forum.kirupa.com/u/stringy)\
**Post date:** [August 8, 2004, 7:02pm UTC](https://forum.kirupa.com/t/multiple-masking/117998/14 "2004-08-08T19:02:06Z")

</div>

> [@shani](#):
>
> tha was niceeeee… yea im tryin to do jus that. is there any way thaa there cud be like more circles 2 giv n aquarium effect. like u know, how the bubbles go up in an aquarium. tha was niceee:thumb:

if you edit the circle thing to make smaller and change the script to this, you won`t be far away. Experiment with changing the variables round.  
createEmptyMovieClip(“paper”, 5);  
mc.setMask(paper);  
function makeBubbles() {  
i++;  
myClip = paper.attachMovie(“c”, “c”+i, i);  
myClip.\_x = Math.round(Math.random()\*Stage.width);  
myClip.\_y = Stage.height;  
myClip.velY = Math.round(Math.random()\*5);  
myClip.onEnterFrame = wobble;  
}  
function wobble() {  
this.\_y -= this.velY;  
this.velY += .2;  
if (this.\_y\<0) {  
removeMovieClip(this);  
}  
}  
myInterval = setInterval(makeBubbles, 50);

You could even shape tween the bubble/bubbles on its own timeline for extra effect.

---

<div class="post-metadata">

**Author:** ![shani](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@shani](https://forum.kirupa.com/u/shani)\
**Post date:** [August 9, 2004, 9:47am UTC](https://forum.kirupa.com/t/multiple-masking/117998/15 "2004-08-09T09:47:33Z")

</div>

ok so i create the circle symbol, put in a movie clip n then make n additional movie clip write the code in it n insert tha code clip in2 the original movie clip. did i get it right?

---

<div class="post-metadata">

**Author:** ![shani](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@shani](https://forum.kirupa.com/u/shani)\
**Post date:** [August 9, 2004, 9:48am UTC](https://forum.kirupa.com/t/multiple-masking/117998/16 "2004-08-09T09:48:35Z")

</div>

how wud i make an image blurry or blurred out in flash?

---

<div class="post-metadata">

**Author:** ![stringy](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@stringy](https://forum.kirupa.com/u/stringy)\
**Post date:** [August 9, 2004, 10:15am UTC](https://forum.kirupa.com/t/multiple-masking/117998/17 "2004-08-09T10:15:07Z")

</div>

> [@shani](#):
>
> ok so i create the circle symbol, put in a movie clip n then make n additional movie clip write the code in it n insert tha code clip in2 the original movie clip. did i get it right?

If you take the last file i uploaded,delete all the code and copy/paste the code above.Then go to the library,find the circle and edit.

---

<div class="post-metadata">

**Author:** ![shani](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@shani](https://forum.kirupa.com/u/shani)\
**Post date:** [August 9, 2004, 10:27am UTC](https://forum.kirupa.com/t/multiple-masking/117998/18 "2004-08-09T10:27:44Z")

</div>

ok, i tried the code out, doesn seem to be workin. i made the image as a movie clip symbol, made another move clip symbol wit the circle in it. placed the movie clip symbol wit the pic in one layer n made n box in the other layer and put the code down in the first layer. doesn seem to be workin

---

<div class="post-metadata">

**Author:** ![shani](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@shani](https://forum.kirupa.com/u/shani)\
**Post date:** [August 9, 2004, 10:35am UTC](https://forum.kirupa.com/t/multiple-masking/117998/19 "2004-08-09T10:35:36Z")

</div>

ok, i also tried out wha u suggested wit changin the code in the file u uploaded. dude ure a genius, hahaha… thas was amazing :thumb:
