# onPress inside OnLoadInit doesn't work

**URL:** <https://forum.kirupa.com/t/onpress-inside-onloadinit-doesnt-work/320690>\
**Category:** flash\
**Created:** [March 30, 2011, 2:14pm UTC](https://forum.kirupa.com/t/onpress-inside-onloadinit-doesnt-work/320690 "2011-03-30T14:14:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sanla327](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@Sanla327](https://forum.kirupa.com/u/Sanla327)\
**Post date:** [March 30, 2011, 2:14pm UTC](https://forum.kirupa.com/t/onpress-inside-onloadinit-doesnt-work/320690/1 "2011-03-30T14:14:58Z")

</div>

Hi,

I try to use onPress function inside an onLoadInit function but nothing will be traced. I can see my hand cursor over my icons though. I also tried with onLoadComplete, but no change…

Here is my code

```
	 //Create objetc for moviecliip loader
	var mLoader:MovieClipLoader = new MovieClipLoader();
	var mcListener:Object = new Object(); 
	
	 var yPos:Number = 10;
	 var yPosArray:Array = new Array;
	 var number:Number = 0;
	 var textArray:Array = new Array;
	
	    //Iterate for each round in game
 	 for (var i = 0; i &lt; game.length; i++) { 	
	 //Load the .swf for each iconname
     var image:MovieClip = this.createEmptyMovieClip("_MC"+i,i);
     mLoader.loadClip("assets/" + game[game.length-i-1].iconname + "IconDrop.swf", image);
	  }
	 
	//When loaded calculate height of .swf, increase yPos
      mcListener.onLoadInit = function(mc:MovieClip):Void
	{  
	 
	  mc._y = yPos;
              yPos += mc._height + 10;
	  yPosArray[number] = yPos;
	  
	   
	[COLOR="Red"] mc.onPress = function()
			{
				trace("Testing");
			} [/COLOR] 
	  
     }
	 
      mLoader.addListener(mcListener);
```
