# Loaded image cant be masked?

**URL:** <https://forum.kirupa.com/t/loaded-image-cant-be-masked/111656>\
**Category:** Uncategorized\
**Created:** [May 29, 2004, 9:03am UTC](https://forum.kirupa.com/t/loaded-image-cant-be-masked/111656 "2004-05-29T09:03:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lordkiller](https://avatars.discourse-cdn.com/v4/letter/l/9fc29f/32.png) [@lordkiller](https://forum.kirupa.com/u/lordkiller)\
**Post date:** [May 29, 2004, 9:03am UTC](https://forum.kirupa.com/t/loaded-image-cant-be-masked/111656/1 "2004-05-29T09:03:03Z")

</div>

Try to mask a dinamicaly loaded img and not work, is a limitation from Flash MX or I make a mistake in my code?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 29, 2004, 9:10am UTC](https://forum.kirupa.com/t/loaded-image-cant-be-masked/111656/2 "2004-05-29T09:10:06Z")

</div>

You have to wait until the image is completely loaded before you can use setMask OR you can put that image inside a container clip and mask the container, which is a lot easier.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 29, 2004, 9:40pm UTC](https://forum.kirupa.com/t/loaded-image-cant-be-masked/111656/3 "2004-05-29T21:40:03Z")

</div>

Thanks for your quick reply  
I loaded in a container, mask the container… nothing.  
How can I now if an img is fully loaded? the loadMovie dont have status or something else…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 29, 2004, 10:28pm UTC](https://forum.kirupa.com/t/loaded-image-cant-be-masked/111656/4 "2004-05-29T22:28:59Z")

</div>

You can use the getBytesLoaded and getBytesTotal methods.

But as I said, the other method is better. Instead of doing

```auto
container.loadMovie ("somePic.jpg") ;
container.setMask (theMask) ;

```

you can do

```auto
container.createEmptyMovieClip ("picContainer", 0) ;
container.picContainer.loadMovie ("somePic.jpg") ;
container.setMask (theMask) ;

```

See what I mean? 🙂
