Hi Dan, Thanks for the tip. I started to do that but then just moved adding the filter to a seperate method which I called after the parentDoc does it's addChild. The reason is that the parent doc calls createChildren when it adds the component to the displayList. In the buttons case it was trying to validate a 2nd UITextField ( part of the UIComponents createChildren method) I wrote some more about it at http://thefactoryfactory.com/wordpress/?p=75 because I was pretty psyched to get it figured out. In the future I think I'll go the route of overriding createChildren though, as per your recommendation.
--- In flexcoders@yahoogroups.com, "Daniel Freiman" <[EMAIL PROTECTED]> wrote: > > I forget the exact reason why this is happening, but the workaround is to > move your code to the createChildren function. > - Dan > > On 10/3/06, joshuajnoble <[EMAIL PROTECTED]> wrote: > > > > Hi, I'm trying to add a dropShadow to a button like so: > > > > public class DropShadowButton extends Button > > { > > > > private var ds:DropShadowFilter; > > > > public function DropShadowButton():void > > { > > super(); > > ds = new DropShadowFilter(); > > var a:Array = new Array(); > > a.push(ds); > > this.textField = new UITextField(); > > this.textField.antiAliasType = > > flash.text.AntiAliasType.ADVANCED; > > this.textField.filters = a; > > this.addChild(textField); > > } > > } > > > > which works fine until, inside UIComponent.as, I throw an error reading: > > > > TypeError: Error #2007: Parameter antiAliasType must be non-null. > > at flash.text::TextField/set antiAliasType() > > at > > mx.core::UITextField/validateNow > > ()[C:\dev\GMC\sdk\frameworks\mx\core\UITextField.as:1427] > > at mx.core::UITextField/set > > nestLevel()[C:\dev\GMC\sdk\frameworks\mx\core\UITextField.as:956] > > > > out of these lines of code: > > > > if (child is ILayoutManagerClient) > > ILayoutManagerClient(child).nestLevel = nestLevel + 1; > > else if (child is UITextField) > > UITextField(child).nestLevel = nestLevel + 1; > > > > Can anyone shed any light on what's going on under the hood? > > > > > > > > > > > > > > > > > > -- > > Flexcoders Mailing List > > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > > Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > > > > > -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/