# Loading external jpg via If statement

**URL:** <https://forum.kirupa.com/t/loading-external-jpg-via-if-statement/281518>\
**Category:** Uncategorized\
**Created:** [February 10, 2009, 8:09am UTC](https://forum.kirupa.com/t/loading-external-jpg-via-if-statement/281518 "2009-02-10T08:09:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![junta](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@junta](https://forum.kirupa.com/u/junta)\
**Post date:** [February 10, 2009, 8:09am UTC](https://forum.kirupa.com/t/loading-external-jpg-via-if-statement/281518/1 "2009-02-10T08:09:01Z")

</div>

I am trying to make an “If” statement for a photo gallery I am building. When you click on a thumbnail movie clip, photo1, I would like button1.jpg to load externally into a holder movie clip. This is the code I have now, which doesn’t work and I can’t figure out why. My jpg’s are saved in the same place as my file, I have checked the easy solutions with no luck. Any help would be great since I am fairly new at this, thanks!

```auto
import gs.TweenLite;
import gs.OverwriteManager
import gs.easing.*

OverwriteManager.init(OverwriteManager.AUTO);

for (var i:Number = 0; i < 19; i++)
{
	
	_root.Target["button" + i].onRelease = function()
	{
		if (!this)
		{
		   TweenLite.to(this,.5,{loadMovie: (i+".jpg", "holder")});
		}
	}
}

```
