2 Replies Latest reply on Nov 15, 2007 7:26 AM by levancho

    Could not resolve x to a component implementation problem

    nmduc073
      Hi,
      I have run an example. The code is listed below:

      [CODE]
      package com.mydomain.components
      {
      import mx.controls.Label;

      public class CircleLabel extends Label {

      public var circleColor:uint = 0x000000;

      public function CircleLabel(){
      super();
      }
      override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
      super.updateDisplayList(unscaledWidth, unscaledHeight);
      // Draw a circle around the label text
      graphics.lineStyle(1, this.circleColor, 1.0);
      graphics.drawEllipse(-5,-5,this.width+10,this.height+10);
      }
      }
      }
      [/CODE]

      [CODE]
      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application
      xmlns:mx=" http://www.adobe.com/2006/mxml"
      xmlns:comps="com.mydomain.components.*"
      backgroundColor="#FFFFFF" >

      <mx:Panel title="CircleLabel Component" width="500" height="90"
      paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"
      layout="horizontal">
      <comps:CircleLabel text="Black Circle Label" circleColor="0x000000" />
      <mx:Spacer width="20" />
      <comps:CircleLabel text="Red Circle Label" circleColor="0xFF0000" />
      </mx:Panel>

      </mx:Application>
      [/CODE]

      I am using Flex Builder 2.0.1. These file are put in the same Flex project and in the same folder. When I compilled them, there was an error: Could not resolve <comps:CircleLabel> to a component implementation.
      Please help me to solve this problem.
      Thank in advance,
      Duc