# onLoad problem

**URL:** https://forum.kirupa.com/t/onload-problem/242397
**Category:** flash
**Created:** [October 25, 2007, 2:40pm UTC](https://forum.kirupa.com/t/onload-problem/242397 "2007-10-25T14:40:28Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![superbungalow](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@superbungalow](https://forum.kirupa.com/u/superbungalow)
#### Post date: [October 25, 2007, 2:40pm UTC](https://forum.kirupa.com/t/onload-problem/242397/1 "2007-10-25T14:40:28Z")

</div>

Why doesn’t this work:

```auto
    evilguy = attachMovie("evil", "evil"+_root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:start_enemy_x, _y:start_enemy_y});
    evilguy.onLoad = function() {
        enemies.push(this._name);
        trace(enemies);
    };

```

It doesn’t trace the array, so I don’t think the onLoad event has worked.  
Thanks
