# Loading image from the library

**URL:** <https://forum.kirupa.com/t/loading-image-from-the-library/17211>\
**Category:** flash\
**Created:** [April 2, 2003, 7:09pm UTC](https://forum.kirupa.com/t/loading-image-from-the-library/17211 "2003-04-02T19:09:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Virgil\_Schleich](https://avatars.discourse-cdn.com/v4/letter/v/dc4da7/32.png) [@Virgil\_Schleich](https://forum.kirupa.com/u/Virgil_Schleich)\
**Post date:** [April 2, 2003, 7:09pm UTC](https://forum.kirupa.com/t/loading-image-from-the-library/17211/1 "2003-04-02T19:09:14Z")

</div>

Hi everyone,

I am pretty new to Flash and am using FlashMX. My question is ‘How to you dynamically extract an image from the library onto a movie clip?’.

Thanks in advance,  
Virgil Schleich  
[vschleich@trilliumteam.com](mailto:vschleich@trilliumteam.com)

---

<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:** [April 2, 2003, 8:51pm UTC](https://forum.kirupa.com/t/loading-image-from-the-library/17211/2 "2003-04-02T20:51:35Z")

</div>

Make that image a movie clip and open your library and right click on it, select “Properties”. Give it a linkage Identifier, for example: **image\_mc**. Make sure the check boxes labeled “Export for Actionscript” and “Export in the first frame” are checked, no need for “Export for runtime sharing” to be checked so just leave that alone. Then on a frame in your movie add this:  
[AS]attachMovie(“image\_mc”, “my\_mc”, 10);  
my\_mc.\_x = 50;  
my\_mc.\_y = 50;[/AS]  
**image\_mc** - the linkage identifier  
**my\_mc** - instance name used for that movie clip when using it in Actionscript  
**10** - depth of the movie clip  
**my\_mc.\_x** - x axis location of movie clip  
**my\_mc.\_y** - y axis location of movie clip

If that didn’t help, reply back and I will go more into depth and maybe support a source file for you.

---

<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:** [April 2, 2003, 9:27pm UTC](https://forum.kirupa.com/t/loading-image-from-the-library/17211/3 "2003-04-02T21:27:05Z")

</div>

hey **telekinesis** =)

you can short the code to

```auto
this.attachMovie("image_mc", "my_mc", 10, {_x:50, _y:50});

```

and the option _export in first frame_ is not necessary…  
you can just drag and drop the symbol from the library onto the stage in a frame before or in the frame of the script 😉

it may save you a future problem if you have a preloader in the movie =)

---

<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:** [April 2, 2003, 9:31pm UTC](https://forum.kirupa.com/t/loading-image-from-the-library/17211/4 "2003-04-02T21:31:51Z")

</div>

I knew about using _this_, but I never knew about adding the axis parameters to the action like that. Thanks, I learn a new thing all the time!

🙂

---

<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:** [April 2, 2003, 9:40pm UTC](https://forum.kirupa.com/t/loading-image-from-the-library/17211/5 "2003-04-02T21:40:36Z")

</div>

yup… you can specify any property, not only \_x and \_y 😉

---

<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:** [April 7, 2003, 12:07pm UTC](https://forum.kirupa.com/t/loading-image-from-the-library/17211/6 "2003-04-07T12:07:55Z")

</div>

Thanks a bunch for the tips. 🙂

---

<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:** [April 7, 2003, 12:17pm UTC](https://forum.kirupa.com/t/loading-image-from-the-library/17211/7 "2003-04-07T12:17:55Z")

</div>

😉 =)
