# Image load on button release problem

**URL:** <https://forum.kirupa.com/t/image-load-on-button-release-problem/313698>\
**Category:** flash\
**Created:** [September 7, 2010, 3:26pm UTC](https://forum.kirupa.com/t/image-load-on-button-release-problem/313698 "2010-09-07T15:26:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![davis\_1114](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@davis\_1114](https://forum.kirupa.com/u/davis_1114)\
**Post date:** [September 7, 2010, 3:26pm UTC](https://forum.kirupa.com/t/image-load-on-button-release-problem/313698/1 "2010-09-07T15:26:30Z")

</div>

I will try to make this as sysinct As possible. I’m working in Flash CS4, AS 2 and I’m trying to make an online image gallery/portfolio but I’m having trouble making an image appear when I release the button. (I’ve uploaded the fla if you want to look).  
Basically, I have a movie clip that will contain all my thumbs and that enters the stage with this action script:

onClipEvent (load) {  
\_root.xnew = \_root.mask.\_x + (-9-1)\*100/2 ;  
}  
onClipEvent (enterFrame) {  
\_x += (\_root.xnew-\_x)/5 ;  
}

and I can control the movement of that clip with 2 buttons:  
To move it right:

on (press) {  
\_root.xnew = \_root.mask.\_x+(-28-1)\*100/2;  
}

To move it back to the left:  
on (press) {  
\_root.xnew = \_root.mask.\_x+(-9-1)\*100/2;  
}

I made the first 3 squares into buttons: imgbtn1, imgbtn2, imgbtn3

I’ve tried loading the images into an empty movie clip a hundred different ways and I’ve also tryed writing action script for the button to just play at a certain frame to show a picture but I have not really gotten anywhere.

Essentially I would like for the thumbs to swoop in as they do and for the user to click a thumb and for that thumb to dynamically load a photo in the center of the stage.

Any help would save my sanity!!  
Thanks,

Joey
