# MovieClip.onLoad dont work

**URL:** https://forum.kirupa.com/t/movieclip-onload-dont-work/17600
**Category:** flash
**Created:** [April 7, 2003, 12:25pm UTC](https://forum.kirupa.com/t/movieclip-onload-dont-work/17600 "2003-04-07T12:25:08Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![tstefan](https://avatars.discourse-cdn.com/v4/letter/t/f475e1/32.png) [@tstefan](https://forum.kirupa.com/u/tstefan)
#### Post date: [April 7, 2003, 12:25pm UTC](https://forum.kirupa.com/t/movieclip-onload-dont-work/17600/1 "2003-04-07T12:25:08Z")

</div>

I was traying to execute this code:

\_root.attachMovie(“t”,“t”,1);  
t.onLoad= function(){  
trace(“spot”);  
}  
stop();

but nothig hapens.  
why?  
(-: (-:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 7, 2003, 12:45pm UTC](https://forum.kirupa.com/t/movieclip-onload-dont-work/17600/2 "2003-04-07T12:45:22Z")

</div>

[http://proto.layer51.com](http://proto.layer51.com)  
i think there’s something about that… not sure though :-\

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 7, 2003, 4:29pm UTC](https://forum.kirupa.com/t/movieclip-onload-dont-work/17600/3 "2003-04-07T16:29:40Z")

</div>

in that case you dont even need the onload because the onload would be called right then anyway. t ‘loads’ right after that attachMovie line, so then you can set values that would correspond to the load values in t.

the proto site does have something for that though. I posted an onload fix there which uses 2 different methods - one a commonly known workaround (bokels) and a cheap onEnterFrame load by me 😉 Someone else also did a more complicated one using getbytes loaded etc I do believe - they posted a link to that at the bottom of my example… actually Ill link that up here:

[http://proto.layer51.com/d.aspx?f=631](http://proto.layer51.com/d.aspx?f=631)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 7, 2003, 4:46pm UTC](https://forum.kirupa.com/t/movieclip-onload-dont-work/17600/4 "2003-04-07T16:46:32Z")

</div>

Funny thing is that it worked after I have clicked on the object and entered a blank line in action script window.  
After that it worked.LOL

[AS]1…  
2…  
[/AS]  
I think that’s funny.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 7, 2003, 4:51pm UTC](https://forum.kirupa.com/t/movieclip-onload-dont-work/17600/5 "2003-04-07T16:51:02Z")

</div>

yes. If you put anything directly on the movieclip itself, the onLoad WILL be recognized by Flash for that movieclip. Its a queer thing that Flash does in handling onLoad… there are some other things about it, and somewhere we had an indepth discussion on its oddities (actually I dont think that was here at Kirupa - some other forum I think) - but its something that everyone hopes is rectified in the next Flash.
