# Is there something I miss with AS3

**URL:** <https://forum.kirupa.com/t/is-there-something-i-miss-with-as3/275336>\
**Category:** flash\
**Created:** [November 12, 2008, 5:42pm UTC](https://forum.kirupa.com/t/is-there-something-i-miss-with-as3/275336 "2008-11-12T17:42:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Didi32](https://avatars.discourse-cdn.com/v4/letter/d/eb8c5e/32.png) [@Didi32](https://forum.kirupa.com/u/Didi32)\
**Post date:** [November 12, 2008, 5:42pm UTC](https://forum.kirupa.com/t/is-there-something-i-miss-with-as3/275336/1 "2008-11-12T17:42:03Z")

</div>

Hi,

Every time I make a script using AS3, I get very confused on a number of issues for which I do not find any answer.  
Here is the one I am struggling with today, I am doing some sort of thumbnail gallery application:

I have a main.as class and a class that ultimately contains an instance of the loader class (to display the image).  
But I also have another class - loaded as well from main.as - that contains an instance of a class for each thumbnail. On click of one thumbnail, I want the loader of the other class to change its content something like this:

thumbnail.addEventListener(MouseEvent.MOUSE\_UP, changeLoaderContent);

private function changeLoaderContent(e:MouseEvent):void {  
// Code either to change the content of the loader instance or calling a function on the stage to change the contentof the loader like this loader.load(urlRequest).  
}

What is the best and most logical way to do this: communicate between two classes created on the stage. Should I use an event dispatcher and a listener on the stage? If I do this, how do I pass values from the thumbnail - like the URL of the large image - to the stage and then the loader.

I have the feeling there should be something simple and straightforward to do this but I don’t know what is best.

Thank you,

didi
