Archive for the ‘Tips’ Category

Alpha transparency on objects with children

Thursday, June 11th, 2009

Ever tried to change the alpha of a movieclip or sprite with multiple children and been annoyed that you can see all of the children changing their alphas separately, creating an undesired effect? An awesome trick is to apply an empty filter, like a blur of 0, and the parent object will be treated as one solid object and give the desired alpha transparency effect. See it in action here:

http://labs.eric-decker.com/?p=178

Update:

My manager, Mark, noticed in the comments of the page I blogged on previously that there’s an even better way to accomplish this…

“If you set the blendMode of your containing DisplayObject to BlendMode.LAYER Flash will consider this DisplayObject as only one layer and will change the alpha the way you normally think it would.”

http://www.zedia.net/2008/blendmodelayer-a-must-when-changing-alpha-of-a-displayobject-containing-other-displayobject/