# Mask in AS3 cross object/multi object masking

**URL:** <https://forum.kirupa.com/t/mask-in-as3-cross-object-multi-object-masking/289007>\
**Category:** flash\
**Created:** [May 25, 2009, 4:42am UTC](https://forum.kirupa.com/t/mask-in-as3-cross-object-multi-object-masking/289007 "2009-05-25T04:42:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![unity\_asia](https://avatars.discourse-cdn.com/v4/letter/u/3ab097/32.png) [@unity\_asia](https://forum.kirupa.com/u/unity_asia)\
**Post date:** [May 25, 2009, 4:42am UTC](https://forum.kirupa.com/t/mask-in-as3-cross-object-multi-object-masking/289007/1 "2009-05-25T04:42:33Z")

</div>

I have a as3 class that loads a number of images from a given location, they are all loaded dynamically with imageloader. However I’m trying to make a Xray screen for all of them, so when I click and drag the Xray screen around, it will reveal the images loaded under each picture, creating a sort of Xray effect.

I tried using masks, however since the images are all loaded dynamically they are its own class with its own layers, I’m trying to make a mask that will work for all of them (I load 2 picture for each image, example car.jpg and carb.jpg, b.jpg being the inside image).

so I have my stage —\> [MyXray Box, and my Images]

so my question is how can I use my Xray Box as a mask for all the Images?  
Since Xray Box is a object of its own, it cannot use its own layers as the mask of another object. How do I do cross object masking?
