# Display Project

**URL:** <https://forum.kirupa.com/t/display-project/243873>\
**Category:** flash\
**Created:** [November 12, 2007, 4:29am UTC](https://forum.kirupa.com/t/display-project/243873 "2007-11-12T04:29:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![swizz182g](https://avatars.discourse-cdn.com/v4/letter/s/f4b2a3/32.png) [@swizz182g](https://forum.kirupa.com/u/swizz182g)\
**Post date:** [November 12, 2007, 4:29am UTC](https://forum.kirupa.com/t/display-project/243873/1 "2007-11-12T04:29:03Z")

</div>

I am creating a custom photo gallery, and i want the different galleries to load when the user presses the button that corresponds with a gallery. I made a class called gallery button who’s constructor takes in a Label Argument and A Gallery Name Argument. Now when this button is clicked it creates a new gallery object and passes it the gallery name argument so that the HSP\_Gallery Class can load and display the pictures.

function onClick(evt:Event)  
{  
var myGallery2:HSP\_Gallery = new HSP\_Gallery(evt.target.name);  
addChild(myGallery2);  
}

The problem is that when the button is clicked the gallery wont show.

Now i have put in trace statements that show the arguments getting passed correctly, but still no gallery.

The only time the gallery shows is when i call the HSP\_Gallery Class without the button being clicked like this:

var myGallery:HSP\_Gallery = new HSP\_Gallery(“gallery.xml”);  
addChild(myGallery);

If more of my code is needed please let me know.  
I know its probally something small i over looked, i would really appreciate it if someone helped

Thank You In Advance
