5 Replies Latest reply on Aug 26, 2009 11:19 PM by smile: )

    Canvas backgroundColor problem

    smile: )

      Hi~

      I have a question here.

      I made a customCanvas which has two Labels, and added it to a VBox.

      I also added eventListener that makes children canvases when it's clicked.

      until children are under 400, it works ok.

      however if making children canvases more than 410 then the children canvases' backgroundColor doesn't work properly.

      It should be yellow. but it has the same color as it's parent canvas' bgColor.

      what is the problem?

       

       

      =======================================================

      var parentCVS:cvs = new cvs();
      baseVBox.addChild(parentCVS);

      parentCVS.addEventListener(MouseEvent.CLICK, mouseEventHandler);

      =======================================================

      private function mouseEventHandler(e:MouseEvent):void{ 
        var thisY:uint = 20;

        var thisCnt:int=1; 
       
        for(var i:int=0;i<500;i++){
         var c:cvs = new cvs();
         e.currentTarget.addChild(c);
         e.currentTarget.verticalScrollPolicy = 'off';
         e.currentTarget.horizontalScrollPolicy = 'off';     
         c.x = 5;
         c.y = thisY;
         thisY += 20;
         c.lb.text = ''+thisCnt++;
         c.lb2.text = ''+thisY;

        }
        e.currentTarget.height += i*20; 
      }