Re: [Flashcoders] TextFormat constructor
=== Quote from MM docs: Usage new TextFormat([font:String, [size:Number, [color:Number, [bold:Boolean, [italic:Boolean, [underline:Boolean, [url:String, [target:String, [align:String, [leftMargin:Number, [rightMargin:Number, [indent:Number, [leading:Number]) : TextFormat === You should either use parameters passed (in order exactly as above) to constructor: var tf:TextFormat = new TextFormat(Arial, 24); OR use no params with constructor and set properties later: var tf:TextFormat = new TextFormat(); tf.underline = true; tf.color = 0xFF; The 2nd way usually is better :-) -- Best regards, GregoryN http://GOusable.com Flash components development. Usability services. Mendelsohn, Michael wrote: Hi list... I thought you could instantiate a TextFormat object like this: var tf:TextFormat = new TextFormat(underline:true, color:0xFF); But that doesn't work as there's a compile error. Why? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] TextFormat constructor
Hi list... I thought you could instantiate a TextFormat object like this: var tf:TextFormat = new TextFormat(underline:true, color:0xFF); But that doesn't work as there's a compile error. Why? - MM ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] TextFormat constructor
underline:true isn't valid, unless you are building an anonymous object. You can pass the values like this but they're not named. You have to pass the values in the order shown in the docs. It would have been a lot more useful if you could pass an object ... Derek Vadneau - Original Message - From: Mendelsohn, Michael [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Tuesday, January 03, 2006 8:39 AM Subject: [Flashcoders] TextFormat constructor Hi list... I thought you could instantiate a TextFormat object like this: var tf:TextFormat = new TextFormat(underline:true, color:0xFF); But that doesn't work as there's a compile error. Why? - MM ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders