# Getting Images from ScrollPane to UI Loader

**URL:** <https://forum.kirupa.com/t/getting-images-from-scrollpane-to-ui-loader/296643>\
**Category:** flash\
**Created:** [September 17, 2009, 4:07pm UTC](https://forum.kirupa.com/t/getting-images-from-scrollpane-to-ui-loader/296643 "2009-09-17T16:07:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rosey500](https://avatars.discourse-cdn.com/v4/letter/r/b3f665/32.png) [@Rosey500](https://forum.kirupa.com/u/Rosey500)\
**Post date:** [September 17, 2009, 4:07pm UTC](https://forum.kirupa.com/t/getting-images-from-scrollpane-to-ui-loader/296643/1 "2009-09-17T16:07:53Z")

</div>

Hello all,

```
 I have a ScrollPane instance on the stage, which is made up of six images stacked vertically, and combined into a movieClip called thumbs1_mc. This movieClip is exported to Actionscript in the library, (class name is thumbs1_mc). What I want to have happen is when the user clicks on the contents of the scrollPane, the full screen image (from a separate folder called /images) should appear in the UILoader. Here's the code so far:

```

import fl.events.ScrollEvent;  
import fl.containers.ScrollPane;  
import fl.containers.UILoader;

var aSp:ScrollPane;  
aSp.setSize(120, 400);  
aSp.source=“thumbs1\_mc”;

var aLoader:UILoader = new UILoader();  
aLoader.source="/images/pix1.jpg";  
aLoader.x=150;  
aLoader.y=5;  
aLoader.scaleContent=false;  
addChild(aLoader);

thumbs\_mc.pix1.addEventListener(MouseEvent.CLICK, ldr1);  
thumbs\_mc.pix2.addEventListener(MouseEvent.CLICK, ldr2);  
thumbs\_mc.pix3.addEventListener(MouseEvent.CLICK, ldr3);  
thumbs\_mc.pix4.addEventListener(MouseEvent.CLICK, ldr4);  
thumbs\_mc.pix5.addEventListener(MouseEvent.CLICK, ldr5);  
thumbs\_mc.pix6.addEventListener(MouseEvent.CLICK, ldr6);

function ldr1(e:MouseEvent):void  
{  
aLoader.source="/images/pix1.jpg";  
}  
function ldr2(e:MouseEvent):void  
{  
aLoader.source="/images/pix2.jpg";  
}  
function ldr3(e:MouseEvent):void  
{  
aLoader.source="/images/pix3.jpg";  
}  
function ldr4(e:MouseEvent):void  
{  
aLoader.source="/images/pix4.jpg";  
}  
function ldr5(e:MouseEvent):void  
{  
aLoader.source="/images/pix5.jpg";  
}  
function ldr6(e:MouseEvent):void  
{  
aLoader.source="/images/pix6.jpg";  
}

What I think this boils down to, is how can I make the individual pictures clickable once they’re in the scrollPane? I’ve tried doing this w/out the scrollPane and it works fine, but I need the scrollability as I intend to add many more images!

Thanks so much-any help is appreciated!!

Rosey
