views:

81

answers:

1
    // When I Run The Following Two Lines, I Get The Error Shown Below
    var B:Button=new Button();
    var lineMetrics:TextLineMetrics=B.measureText('Hello World');
    //   TypeError: Error #2007: Parameter antiAliasType must be non-null.

From My Point Of View, As Useless Errors Go, This One Is Unsurpassed.

Can anyone point me in the right direction?

A: 

The last post in this thread may help: http://www.actionscript.org/forums/showthread.php3?t=148610

TandemAdam
This worked. I needed to first add it to the canvas (canvas.addChild), then update its width. measureText will fail quite magnificently if called on a component that isn't already visible on the stage.
Joshua