# onRelease event

**URL:** <https://forum.kirupa.com/t/onrelease-event/276952>\
**Category:** flash\
**Created:** [December 5, 2008, 12:46pm UTC](https://forum.kirupa.com/t/onrelease-event/276952 "2008-12-05T12:46:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Voursez](https://avatars.discourse-cdn.com/v4/letter/v/b5ac83/32.png) [@Voursez](https://forum.kirupa.com/u/Voursez)\
**Post date:** [December 5, 2008, 12:46pm UTC](https://forum.kirupa.com/t/onrelease-event/276952/1 "2008-12-05T12:46:19Z")

</div>

Hey folks.

Im trying to load in some images from a xml-file, and make them into buttons (give them an onRelease function). I really had expected this to work, but apparently not. What am I doing wrong?

[AS]  
var xml:XML = new XML();  
xml.ignoreWhite = true;  
xml.onLoad = function(){  
var images:Array = xml.firstChild.childNodes;  
for(var i=0;i\<images.length;i++){  
trace(images\*.attributes.url);  
holder = createEmptyMovieClip(“holder”+i, i);  
holder.\_x = 5;  
holder.\_y = 112_i+5;  
loadMovie(images_.attributes.url, holder);  
trace(holder);  
holder.onRelease = function(){  
trace(“test”);  
}  
}  
}  
xml.load(“images.xml”);[/AS]
