0
我在Flex(Flash Builder 4)中有這個奇怪的問題,在HorizontalList它崩潰時,只要我滾動到快速,任何人有一個想法? 這裏是我的自定義項目渲染器HorizontalList崩潰滾動「太快」時
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);
}
}
}