MovieClip.onLoad dont work

I was traying to execute this code:

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

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

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

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 :wink: 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

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.

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.