March 20, 2003
onClipEvent(initialize)

For all those who still like to program the onClipEvent way Ted Patrick has discovered an undocumented Flash MX feature: there exist an onClipEvent(initialize) which gets fired before the onClipEvent(load) function. The question remains what this might be good for, currently the only use could be Peter Elst's proposal to dynamically define an onload handler, something like this:

onClipEvent(initialize) {
this.onLoad = function() {
trace("onLoad function defined in initialize event");
}
}

Posted at March 20, 2003 06:19 PM | Further reading
Comments

Intialize allows load (well initialize) events on child movieclips to be fired before a parent load event. Normally, load events begin with parents first, followed by the load events of each consecutive child movieclip followed by each of their child movieclip(s) and so on. Using intialize on child movieclips allows you to run script prior to any parent's load event beating them to the punch since all child movieclips' initialize events happen before any load event. This allows interior setting of functions or variables or whathaveyou which can then be accessed by a parent's load event.

Posted by: senocular on March 22, 2003 07:20 PM

Just a heads up since i came across your website by accident... maybe offering simple clarity

onClipEvent(initialize) {
....
}

... happens before the script that is on the same frame the movieclip/component is on.

example:

onClipEvent(initialize) {
trace("initialize script: "+this);
}

and on the same frame the component/movieclip resides in, simply put:

trace("frame script: "+this);

the end result in your output window being:

initialize script: _level0.instance0
frame script: _level0

enjoy.

Posted by: Alan MacDonald on October 6, 2005 03:13 AM
Post a comment
Name:


Email Address:


URL:


Comments:


Remember info?



Thank you!

Most Visited Entries
Sketches, Works & Source Code
Lectures
Contact
Backlog
In Love with
Powered by
Movable Type 2.661

© Copyright Mario Klingemann

Syndicate this site:
RSS 1.0 - RSS 2.0

Quasimondo @ flickr
Quasimondo @ LinkedIn
Quasimondo @ Twitter
Quasimondo @ Facebook
Quasimondo @ MySpace
Quasimondo is a Bright
Citizen of the TRansnational Republic
My other blog in german
Impressum


My family name is written Klingemann,
not Klingelmann, Klingeman, Klingaman, Kingemann,
Kindermann, Killingaman, Klingman, Klingmann, Klingonman
Klingemman, Cleangerman, Klingerman or Kleangerman

profile for Quasimondo at Stack Overflow, Q&A for professional and enthusiast programmers