1 Reply Latest reply on May 12, 2009 11:15 AM by BennyBeta

    LineMetricsReader not found

    ShaF10 Level 1

      Hi Guys

       

      I am trying to use the LineMetricsReader in my application but I keep getting the following error:

       

      1046: Type was not found or was not a compile-time constant: LineMetricsReader

       

      I have imported flash.text.TextLineMetrics class so from what I know it should be working ...

        • 1. Re: LineMetricsReader not found
          BennyBeta Level 4

          LineMetricsReader is not a built-in ActionScript class.  Rather it seems to be a class specified in an example in the TextLineMetrics documentation (http://livedocs.adobe.com/flex/3/langref/flash/text/TextLineMetrics.html), towards the bottom.

           

          import flash.text.TextLineMetrics;

          class LineMetricsReader {
              private var metrics:TextLineMetrics;

              public function LineMetricsReader(metrics:TextLineMetrics) {
                  this.metrics = metrics;
              }

              public function toString():String {
                  return "[TextLineMetrics ascent:" + metrics.ascent
                      + ", descent:" + metrics.descent
                      + ", leading:" + metrics.leading
                      + ", width:" + metrics.width
                      + ", height:" + metrics.height
                      + ", x:" + metrics.x
                      + "]";
              }
          }

           

          HTH,

           

          Ben