# Multiple Mask and Random Image

**URL:** <https://forum.kirupa.com/t/multiple-mask-and-random-image/120506>\
**Category:** Uncategorized\
**Created:** [August 25, 2004, 1:06am UTC](https://forum.kirupa.com/t/multiple-mask-and-random-image/120506 "2004-08-25T01:06:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lazyme](https://avatars.discourse-cdn.com/v4/letter/l/5daacb/32.png) [@lazyme](https://forum.kirupa.com/u/lazyme)\
**Post date:** [August 25, 2004, 1:06am UTC](https://forum.kirupa.com/t/multiple-mask-and-random-image/120506/1 "2004-08-25T01:06:49Z")

</div>

I hope someone can give me a hand on this.

I am doing a multiple mask where an image is being masked by multiple little squares that drop down.

I created 2 layers, mask and masked for each square and image.

That part works fine, however, I wanted to load a different image everytime when the page loads, I used the example on this site:

choice = Math.round(Math.random()\*6);  
switch (choice) {  
case 0 :  
location.loadMovie(“image0.swf”);  
break;  
case 1 :  
location.loadMovie(“image1.swf”);  
break;  
…  
}

Now, every little square load a random image instead of all loading the same image. Is it possible to ask all other masked layer to call on that one random image? What should I do?

---

<div class="post-metadata">

**Author:** ![mprzybylski](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mprzybylski/32/613_2.png) [@mprzybylski](https://forum.kirupa.com/u/mprzybylski)\
**Post date:** [August 25, 2004, 1:36am UTC](https://forum.kirupa.com/t/multiple-mask-and-random-image/120506/2 "2004-08-25T01:36:57Z")

</div>

i’m having a hard time understanding what you’re trying to say so if you could post an fla that would help a bit.

are you masking multiple images with multiple squares or squares on separate layers that mask the same image on different layers? not exactly sure what you’re saying…

---

<div class="post-metadata">

**Author:** ![lazyme](https://avatars.discourse-cdn.com/v4/letter/l/5daacb/32.png) [@lazyme](https://forum.kirupa.com/u/lazyme)\
**Post date:** [August 25, 2004, 6:39am UTC](https://forum.kirupa.com/t/multiple-mask-and-random-image/120506/3 "2004-08-25T06:39:14Z")

</div>

I am doing a multiple masking on one image.

The way I do this multiple masking is by creating 2 layers for each mask: mask and masked layer.

I also want to generate a random masked image everytime it loads.

With the code I used above, each masking layer (mask and masked), I inserted the code for the masked layer. So, the effect I want is a multiple mask on a random image.

But the result is random image for each mask with the current setup.

But I want each mask to call the same random image.

How do I achieve that?

---

<div class="post-metadata">

**Author:** ![lazyme](https://avatars.discourse-cdn.com/v4/letter/l/5daacb/32.png) [@lazyme](https://forum.kirupa.com/u/lazyme)\
**Post date:** [August 25, 2004, 8:34pm UTC](https://forum.kirupa.com/t/multiple-mask-and-random-image/120506/4 "2004-08-25T20:34:47Z")

</div>

Another way of saying this is, can all masked layers call to one random image?
