Issue
When you use Adobe Flex Builder to create an ActionScript Class (from the menus), the ActionScript that Flex Builder generates is incorrect. This issue occurs if the constructor contains an argument of type String and also has a default value.
Flex Builder creates the following constructor method:
Public function MyOtherStroke(color:uint=0, weight:Number=0, alpha:Number=1, pixelHinting:Boolean=false, scaleMode:String=normal, caps:String=null, joints:String=null, miterLimit:Number=0) { super(color, weight, alpha, pixelHinting, scaleMode, caps, joints, miterLimit); }
Expected results:
public function MyOtherStroke(color:uint=0, weight:Number=0, alpha:Number=1, pixelHinting:Boolean=false, scaleMode:String='normal', caps:String=null, joints:String=null, miterLimit:Number=0) { super(color, weight, alpha, pixelHinting, scaleMode, caps, joints, miterLimit); }
The word normal in the scaleMode:String= argument should be in quotes.
Solution
Manually edit the ActionScript code, adding the single (or double, if you want) quotes around the default string value.
For example, scaleMode:String='normal'
Additional information
This article was published on July 29 2008. If you are using a newer build of Flex than is mentioned here, this information may not apply to you.