# Filling the Box with a little picture

**URL:** <https://forum.kirupa.com/t/filling-the-box-with-a-little-picture/185329>\
**Category:** flash\
**Created:** [April 12, 2006, 3:02pm UTC](https://forum.kirupa.com/t/filling-the-box-with-a-little-picture/185329 "2006-04-12T15:02:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Romberry](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@Romberry](https://forum.kirupa.com/u/Romberry)\
**Post date:** [April 12, 2006, 3:02pm UTC](https://forum.kirupa.com/t/filling-the-box-with-a-little-picture/185329/1 "2006-04-12T15:02:01Z")

</div>

Hi,

I want to make a little flash application which is just about filling a box with a default picture, size 10x10. What I want is, when a user draw a box with mouse, to fill this box with default picture.

Could you actually help me to do it?

Thanx  
RomBerry

---

<div class="post-metadata">

**Author:** ![rufusW](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@rufusW](https://forum.kirupa.com/u/rufusW)\
**Post date:** [April 12, 2006, 3:30pm UTC](https://forum.kirupa.com/t/filling-the-box-with-a-little-picture/185329/2 "2006-04-12T15:30:23Z")

</div>

Hi RomBerry

This is all about events and responses.

Firstly you’d have to respond to the user’s mouse and draw a box.

Then, when the box is draw, import the picture.

To import the picture, create an empty movieClip, as a child of the box movieclip and load the picture into it.

Voila!

---

<div class="post-metadata">

**Author:** ![Romberry](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@Romberry](https://forum.kirupa.com/u/Romberry)\
**Post date:** [April 12, 2006, 3:41pm UTC](https://forum.kirupa.com/t/filling-the-box-with-a-little-picture/185329/3 "2006-04-12T15:41:42Z")

</div>

Thank you for your answer rufusW.

I found an example on the internet, where user can draw a rectangle and fill it with a colour if neccessary.

Could you just explain more detailed how I can import the picture in the box actually?

Thank you  
RomBerry

---

<div class="post-metadata">

**Author:** ![rufusW](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@rufusW](https://forum.kirupa.com/u/rufusW)\
**Post date:** [April 12, 2006, 4:03pm UTC](https://forum.kirupa.com/t/filling-the-box-with-a-little-picture/185329/4 "2006-04-12T16:03:13Z")

</div>

Sure.  
What you need to do is this:-

1. Create an empty movieClip.

2. On this movieClip craete 2 empty MovieClips. When you make the movieClips you need to specify the depth. It’s important that the highest level is the box and the lowest level is the picture! You could even call the movieClips ‘box’ and ‘picture’! :hugegrin:

3. In your ‘box’ movieClip you draw your box (In response to your user).

4. And then, in your picture movieClip, you import your picture. Use loadMovie to load a Jpeg into the picture movieClip.

Having said all that, if your box is always going to be 10x10 you could always have a movieClip in the Library and just load it from the library.

---

<div class="post-metadata">

**Author:** ![Romberry](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@Romberry](https://forum.kirupa.com/u/Romberry)\
**Post date:** [April 13, 2006, 7:35am UTC](https://forum.kirupa.com/t/filling-the-box-with-a-little-picture/185329/5 "2006-04-13T07:35:49Z")

</div>

rufusW, thank you so much.

It was really so helpful. Now I have to figure out all these things and make the application :pleased:
