4
    // 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?

Joshua
  • 6,643
  • 15
  • 55
  • 76

1 Answers1

2

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

Adam Harte
  • 10,369
  • 7
  • 52
  • 85
  • 1
    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 May 27 '10 at 01:11
  • Or you could just create an addedToStage event handler – Arman Bimatov Jul 11 '13 at 19:03