2011-04-29 126 views
0

我在Flex(Flash Builder 4)中有這個奇怪的問題,在Horizo​​ntalList它崩潰時,只要我滾動到快速,任何人有一個想法? 這裏是我的自定義項目渲染器Horizo​​ntalList崩潰滾動「太快」時

package 
{ 
    import flash.events.Event; 
    import flash.events.MouseEvent; 
    import flash.net.URLLoader; 
    import flash.net.URLRequest; 
    import flash.text.StyleSheet; 
    import flashx.textLayout.container.ScrollPolicy; 
    import mx.containers.VBox; 
    import mx.controls.Image; 
    import mx.controls.Label; 
    import mx.core.FlexGlobals; 

    public class CustomItemRenderVBox extends VBox 
    { 
     private var track:Object = null; 
     private var img:Image = new Image(); 
     private var lbl:Label = new Label(); 
     [Embed(source="gfx/noArt.png")] 
     [Bindable] 
     private var noArt:Class; 


     override public function set data(value:Object):void 
     { 
      trace(value); 
     if(value.c3 != "") 
     try{ 
      addChild(img); 
      addChild(lbl); 

      horizontalScrollPolicy = ScrollPolicy.OFF; 
      verticalScrollPolicy = ScrollPolicy.OFF; 
      setStyle("verticalAlign", "top"); 
      setStyle("horizontalAlign","left"); 
      track = value; 
      trace("Art: " + value.Art); 

      if(value.Art == "" || value.Art =="-") 
      img.source = noArt; else  
      img.source = value.Art; // << when I remove this part it works fine 
      trace("GAY"); 
      img.height = 60; 
      img.scaleContent = true; 
      img.autoLoad = true; 

      lbl.text = value.c3; 
      lbl.width = 67; 
      lbl.height = 20; 
      trace("WAY"); 
      img.useHandCursor = true; 
      img.buttonMode = true; 

      lbl.useHandCursor = true; 
      lbl.buttonMode = true; 
      trace("NAY"); 
      img.addEventListener(MouseEvent.CLICK,arClick); 
      lbl.addEventListener(MouseEvent.CLICK,arClick); 


     }catch(E:Error) 
     { 
     } 
     } 


     private function arClick(event:MouseEvent):void 
     { 
      FlexGlobals.topLevelApplication.albumSearch("/album " + track.c3); 
     } 
    } 
} 

回答

1

我有同樣的問題。在谷歌瀏覽器中,我們可以看到:「0x00000000」處的指令引用了「0x00000000」處的內存。內存不能被「寫入」。 解決方案:我試着在我的滾輪實例上設置cachePolicy =「on」。您應該將其設置爲您的列表組件(或滾動條皮膚部分)