# Get name of jpg inside mc?

**URL:** <https://forum.kirupa.com/t/get-name-of-jpg-inside-mc/102574>\
**Category:** Uncategorized\
**Created:** [February 25, 2004, 1:53am UTC](https://forum.kirupa.com/t/get-name-of-jpg-inside-mc/102574 "2004-02-25T01:53:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lunatic](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@lunatic](https://forum.kirupa.com/u/lunatic)\
**Post date:** [February 25, 2004, 1:53am UTC](https://forum.kirupa.com/t/get-name-of-jpg-inside-mc/102574/1 "2004-02-25T01:53:46Z")

</div>

Okay the subject line was ambiguous but hopefully this description is not! 🙂

I have a bunch of buttons. When you click on a button it dynamically loads a jpg into a holder movie clip. I have a button next to the holder movie clip that says “enlarge photo”. I would like the user to be able to click on the enlarge photo button and have whatever image happens to be in the small viewer at the time load into a larger viewer. Obviously I would be loading a different sized image but what I want to know is - how can I grab the name of the photo that was loaded into the small viewer when one button was pressed so that I can load the corresponding larger photo when the enlarge button is pressed? Should I store the name in a variable at the time the particular photo button is pressed and then pass that variable when the enlarge photo button is pressed?

Does this make any sense? :huh:

Thanks for any help!

---

<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:** [February 25, 2004, 3:24pm UTC](https://forum.kirupa.com/t/get-name-of-jpg-inside-mc/102574/2 "2004-02-25T15:24:42Z")

</div>

Sure!

The code from the individual buttons to the little holder is:  
[AS]  
on(release){  
\_root.MC1.viewer.loadMovie(“photos/smallphoto3.jpg”);  
}  
[/AS]

Where viewer is the small version empty movie cip. Then on MC1 next to the viewer is the EnlargePhoto button that would do something like  
[AS]  
on(release){  
\_root.holder.\_visible = true;  
\_root.holder.clip.loadMovie(“photos/bigphoto3.jpg”);  
}  
[/AS]

I have the big photo loading into a draggble movie clip - hence holder then clip.

🙂

---

<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:** [February 25, 2004, 4:43pm UTC](https://forum.kirupa.com/t/get-name-of-jpg-inside-mc/102574/3 "2004-02-25T16:43:19Z")

</div>

So I ended up storing the name of the big pic inside a global variable and then used that global variable when the EnlargePhoto button is pressed. Is that a good way to do it or is there a better way? Just trying to improve my AS skills here.

Thanks for any input!
