# Help triggering an animation using actionscript

**URL:** <https://forum.kirupa.com/t/help-triggering-an-animation-using-actionscript/248605>\
**Category:** Uncategorized\
**Created:** [January 10, 2008, 2:22am UTC](https://forum.kirupa.com/t/help-triggering-an-animation-using-actionscript/248605 "2008-01-10T02:22:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![FrederikM](https://avatars.discourse-cdn.com/v4/letter/f/8e7dd6/32.png) [@FrederikM](https://forum.kirupa.com/u/FrederikM)\
**Post date:** [January 10, 2008, 2:22am UTC](https://forum.kirupa.com/t/help-triggering-an-animation-using-actionscript/248605/1 "2008-01-10T02:22:23Z")

</div>

Hey all,  
I’ve managed to get my thumbnails and gallery working, but now im focused on making a “zooming” window with a darkening background, to display the larger image when you click on its thumbnail (see [http://www.doknowevil.net/litebox/](http://www.doknowevil.net/litebox/) for a java version of this, i’m trying to get a similar effect in flash).  
I’ve created a movieclip (“window”), and within that two other movieclips, one is a large black background which increases in opacity (“background”), and the other mc is a window “zooming” (“graphic”). I’m now wondering how to structure my actionscript code to play the animation(s) once, when clicking on the thumbnail.  
I’ve got this so far (loading the image when clicked on). Do i need to have an “action” layer within the “window” movieclip, or do i only have to code in the original scene?

```auto
thumbnail_mc.onRelease = function(){
            window.graphic.loadMovie(currentimage.attributes.thumb);
        }

```

I’ve attached my .FLA if it helps.  
Any advice or link to where this kind of stuff is covered would be much appreciated! Many thanks already!

regards, Frederik

edit: I’ve updated the file and added the xml.
