I’m having some trouble with this statement.
I want to initialize a few variables when the playhead encounters a movieclip, thus loading it. Normally, you would have to simply use [size=1][color=navy]onClipEvent(load) { }[/color][/size]
But in order to use this, you have to put this code on the object itself, and can’t use it in the following manner: [size=1][color=navy]mc_ball.onClipEvent(load){ }[/color][/size]
This would result in an error.
But that’s exactly what I need, since I don’t want the code to reside on the object itself, but in a framescript.
So I tried this code: [size=1][color=navy]mc_ball.onLoad = function() { }[/color][/size] But this doesn’t do anything. No errors, but it simply doesn’t do anything. That’s probably because this is only used in combination with the [size=1][color=navy]_root.loadMovie(“mc_ball”)[/color][/size] statement? So, it works only when you dynamically load a movie from the library?
So my question: How can I execute a piece of code when a movieclip is loaded, without having to put the code in a movieclip-script, but in a framescript???
Thanks in advance,
Kasper