1 Reply Latest reply on Jan 21, 2010 12:39 AM by RUSH-ME

    Mouse Click on particular area

    venkateshk Level 1

      I have the canvas

      <mx:Canvas id="b1" x="10" y="10" height="40" width="300" creationComplete="cc()"/>

      and i added rectangles inside this canvas

                     private var unit:int = 15;

                     for(var i:int=b1.x;i<b1.x+b1.width;i=i+unit)
                      {
                          var line1:UIComponent = new UIComponent();
                          var lineThickness1:Number = 1;
                          var lineColor1:Number = 0x000000;
                          var lineAlpha1:Number = 1;
                          line1.graphics.lineStyle(lineThickness1,lineColor1,lineAlpha1);
                          line1.graphics.moveTo(i,b1.y);
                          line1.graphics.drawRect(i,b1.y,unit,b1.height);
                          this.addChild(line1);
                      }

      when running this application i get the canvas with multiple rectangles

      now my assumption is that

      if i click inside a particular rectangle at any place that rectangle needs to fill with color based on the mouse click

      and how could i add labels in those rectangles

      please help........... me