Sam Neff recently explored how setStyle notifies components of style changes, and the results are definitely worth noting (this may save you some major headaches, so listen up). It seems that every time you call setStyle, it calls notifyStyleChangeInChildren(), which iterates through EVERY movieclip in your movie, checking to see if it should notify it of the style change… ouch! Double-ouch even.
This was very useful information for me, as I’m presently working on a (top secret) project that has 100+ components instantiated at a time, and I was a little confounded as to why initializing the first interface was taking about 12 seconds. It all became very clear when I realized that I was setting about 40 different styles, which resulted in literally TENS of THOUSANDS of movieclip “style checks”. Moving the setStyle calls to the first frame solved the problem completely.
The moral of this story: always set all of your global style information before instantiating ANY movieclips, and then don’t change it – at least until Macromedia changes their EULA, and someone can legally distribute a fix for it (jab, jab). 😉