# Question about masking a dynamic image

**URL:** <https://forum.kirupa.com/t/question-about-masking-a-dynamic-image/89418>\
**Category:** Uncategorized\
**Created:** [May 8, 2005, 4:42am UTC](https://forum.kirupa.com/t/question-about-masking-a-dynamic-image/89418 "2005-05-08T04:42:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sirenetta1](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@Sirenetta1](https://forum.kirupa.com/u/Sirenetta1)\
**Post date:** [May 8, 2005, 4:42am UTC](https://forum.kirupa.com/t/question-about-masking-a-dynamic-image/89418/1 "2005-05-08T04:42:27Z")

</div>

I have a picture that I’m loading dynamically into a movieclip. My problem is that the entire picture loads in, when I’d just like the face to appear (not the white background of the picture). I read about “setMask” and thought that I could load the picture into a mask, but I’m not sure how. Can you help? How do you load a jpg into a mask with a fade-in effect?

On the first frame I have:

```auto
_root.createEmptyMovieClip("background", 1);
background.loadMovie("sunny.jpg");
background._x = 0;
background._y = 130;
_root.imageLoaded = true;
background._alpha = 0;
sunny.setMask(background);
stop();

```

On my background MC, I have:

```auto
onClipEvent (enterFrame) {
if (_root.imageLoaded == true and _root.background.getBytesLoaded() == _root.background.getBytesTotal()) {
if (_root.background._alpha<100) {
_root.background._alpha += 5;
} else {
_root.imageLoaded == false;
}
}
}

```

I’ll attach my attempt to this post!!
