# AS2; FLASH 8 ; onRelease function not working for movie clip

**URL:** <https://forum.kirupa.com/t/as2-flash-8-onrelease-function-not-working-for-movie-clip/241015>\
**Category:** flash\
**Created:** [October 9, 2007, 1:36pm UTC](https://forum.kirupa.com/t/as2-flash-8-onrelease-function-not-working-for-movie-clip/241015 "2007-10-09T13:36:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rpkhatri\_ind](https://avatars.discourse-cdn.com/v4/letter/r/ccd318/32.png) [@rpkhatri\_ind](https://forum.kirupa.com/u/rpkhatri_ind)\
**Post date:** [October 9, 2007, 1:36pm UTC](https://forum.kirupa.com/t/as2-flash-8-onrelease-function-not-working-for-movie-clip/241015/1 "2007-10-09T13:36:02Z")

</div>

hi every body,  
plaease help if anybody can!  
i m a mediator or u can way still beginner for flash8 & actionscript 2.0;  
please have a look at this screenshot of flash file i m working on.

(please see actionscript at the last of this page)

![](http://www.rattanindia.com/images/stage.png)

the seven dots u see on the stage are 7 emptymovieclips. i’ve coded the action script  
to load the thumbnails in 6 emptymovieclips on left side arranged in grid ( u can see).  
script is working fine till 6 thumbnails are loaded in the grid.(from externel xml file as i’ve coded)

as logically u can guess that, when we click on a thumbnail, it’s bigger copy should be loaded in the black square on he stage. but it is not happening ; i;ve coded for it also ;  
in the following script u can see that the last command is:  
[FONT=Calibri]\_root.thumb0.onRelease = function() {[/FONT]  
[FONT=Calibri]trace (“clicked”);[/FONT]  
[FONT=Calibri]}[/FONT]  
[FONT=Calibri][FONT=Arial]it should dispaly “clicked” on output window when thumb0 is clicked but it isn’t showing anything. not any error even. the above line is in firstframe’s action script; and it must should work from here only, not under the AS of thumb0 movieclip.[/FONT][/FONT]  
[FONT=Calibri][FONT=Arial]//////////////////////////////////////////////////////actionscript for the first frame of layer1///////////////////////////////////[/FONT][/FONT]  
[FONT=Calibri]xmlData = new XML();[/FONT]  
[FONT=Calibri]xmlData.ignoreWhite = true;[/FONT]  
[FONT=Calibri]xmlData.onLoad = loadXML;[/FONT]  
[FONT=Calibri]xmlData.load(“david.xml”);[/FONT]  
[FONT=Calibri]function loadXML(loaded) {[/FONT]  
[FONT=Calibri]if (loaded) {[/FONT]  
[FONT=Calibri]image = [];[/FONT]  
[FONT=Calibri]var xmlNode:XMLNode = this.firstChild;[/FONT]  
[FONT=Calibri]total = xmlNode.childNodes.length;[/FONT]  
[FONT=Calibri]for (i=0; i\<total; i++) {[/FONT]  
[FONT=Calibri]image\* = xmlNode.childNodes\*.childNodes[0].firstChild.nodeValue;[/FONT]  
[FONT=Calibri]}[/FONT]  
[FONT=Calibri]loadthumbs();[/FONT]  
[FONT=Calibri]}[/FONT]  
[FONT=Calibri]else {[/FONT]  
[FONT=Calibri]trace (“xml file not loaded”);[/FONT]  
[FONT=Calibri]}[/FONT]  
[FONT=Calibri]}[/FONT]  
[FONT=Calibri]function loadthumbs() {[/FONT]  
[FONT=Calibri]\_root.thumb0.loadMovie(image[0]+"\_thumb.jpg");[/FONT]  
[FONT=Calibri]\_root.thumb1.loadMovie(image[1]+"\_thumb.jpg");[/FONT]  
[FONT=Calibri]\_root.thumb2.loadMovie(image[2]+"\_thumb.jpg");[/FONT]  
[FONT=Calibri]\_root.thumb3.loadMovie(image[3]+"\_thumb.jpg");[/FONT]  
[FONT=Calibri]\_root.thumb4.loadMovie(image[4]+"\_thumb.jpg");[/FONT]  
[FONT=Calibri]\_root.thumb5.loadMovie(image[5]+"\_thumb.jpg");[/FONT]  
[FONT=Calibri]}[/FONT]  
[FONT=Calibri]\_root.thumb0.onRelease = function() {[/FONT]  
[FONT=Calibri]trace (“clicked”);[/FONT]  
[FONT=Calibri]}[/FONT]
