This content has been marked as final. Show 2 replies
The onClipEvent() handlers were largely surpassed when Flash 6 came out in 2001. Unfortunately many tutorials, etc. were made with the old style and never updated. So many folks come to Flash and some how learn those and never change – despite the, to me at least, obvious benefits of the MovieClip.onClipEvent approach.
David Stiller has written a good article about it:
And, they have been depreciated. If you publish for AS3, then you won't be able to put code on instances – only in external .as files and timeline/frames.
The load event is instance based vs code on the timeline (of that movie
clip) being symbol based. If you have 2 copies of that symbol on your
main timeline, code within the symbol's timeline will always be the same for
both of those copies. Using the onClipEvent(load) event handler you can
change the code for each instance individually because you can easily write
two different load handlers for both.
As Rothrock said, though, there isn't much point to using these kinds of
commands since Flash 6 and dynamic events, onClipEvent style events are
pretty dead in the water. Most people only use them now because they're
used to an older style of coding. onClipEvent(load) is actually an
exception in that there is no (direct) comparable dynamic event handler. An
onLoad exists, but only works in certain situations. Instead, you would
just write code directly within the parent timeline containing the movie
"OrangeHaze" <email@example.com> wrote in message
> Hello, I am curious if there is any benefit to putting code inside the
> onClipEvent(load) event handler instead of simply putting any code you
> want run
> on the very first frame of the movieclip? It seems that both yield the
> results; however, Adobe/Macromedia seems to discourage putting code
> directly on
> MovieClips and Buttons, so I'm actually curious why the onClipEvent
> handler has
> not been deprecated.