2012-08-22 37 views
1

我已创建了一个磁贴列表,磁贴列表中的每个磁贴都是在翻转时绘制图形的画布。当鼠标从特定的画布上展开时,必须移除绘制的图形。所以我在做graphics.clear但不能删除图形。清除鼠标从画布中滚动时的图形

代码

protected function canvas1_updateCompleteHandler(event:FlexEvent):void 
      {   
       var allowHighLight:Boolean = QzGridImpl(this.owner).m_bEnableHighLight; 
       if(!allowHighLight) 
        return; 
       var highLighted:Boolean = TileList(this.owner).isItemHighlighted(this.data); 
       if(highLighted) 
       { 
        high = true; 
        DrawBackgroundImage(QzGridImpl(this.owner).m_strBackgroundImage as String); 


       } 
//when highlighted becomes false the below part is called 
       else 
       { 

        if(high) 
        { 



         this.graphics.endFill();//and cleanly im observing that endfill and clear is getting called and they are able to clear graphics when mouse is rolled out slowly but not able to clear when mouse is rolled out fast. 

         trace("endfill"); 
         this.graphics.clear(); 
         trace("clear"); 



        } 
       } 


private function DrawBackgroundImage(n_strBackImg:String):void 
{ 

//code for drawing the background image 
} 

,干净,我观察到endfill和清晰的获取调用,他们是能够清除当鼠标铺开缓慢,但不能当鼠标快速推广到清晰的图形。

需要做些什么才能使其工作?

回答

0

您可以为TileList创建自定义ItemRenderer,并在itemRenderer触发翻转时(通过将rollOver侦听器添加到呈示器)应用图像效果。这可能会奏效 - 也可能是一个更好的方法。