# Problem assigning onPress action

**URL:** <https://forum.kirupa.com/t/problem-assigning-onpress-action/178655>\
**Category:** Uncategorized\
**Created:** [February 13, 2006, 4:41am UTC](https://forum.kirupa.com/t/problem-assigning-onpress-action/178655 "2006-02-13T04:41:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixeldude](https://avatars.discourse-cdn.com/v4/letter/p/57b2e6/32.png) [@pixeldude](https://forum.kirupa.com/u/pixeldude)\
**Post date:** [February 13, 2006, 4:41am UTC](https://forum.kirupa.com/t/problem-assigning-onpress-action/178655/1 "2006-02-13T04:41:14Z")

</div>

Heloo…

Okay I just have a code attaching mc for create a thumbnail…so my problem is I can’t assign a onPress action…because when I test it …it’s seem not working…so I really need help u guys …at least tell me what’s wrong with this code…for load image thumnail part is okay only for assigning onpress action…

```auto

stop();

tArray = ["bear0","bear1","bear2"];
for (var i = 0; i<tArray.length; i++) {
		mythumb = attachMovie("box","box"+i,10+i);
		mythumb._x = 30+mythumb._width*i;
		mythumb._y = 10;
		var mymc = mythumb.createEmptyMovieClip("holder"+i,50+i);
		mymc.loadMovie(tArray*+".gif",99);
//////////////// only this part it's not working //////////////
		mymc.onPress= function(){
			trace("whoopss")		
		}
//////////////////////////////////////////////

}

```

Any help would be appreciate…tq in advanced…
