当滚动“太”时 HorizontalList 崩溃快速地
我在 Flex(Flash Builder 4) 中遇到这个奇怪的问题,在 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);
}
}
}
I have this strange problem in Flex(Flash Builder 4), in HorizontalList it crash whenever I scroll to fast, anyone got an idea?
here's my Custom item renderer
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);
}
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我有同样的问题。在 google chrome 中我们可以看到:“0x00000000”处的指令引用了“0x00000000”处的内存。内存无法被“写入”。
解决方案:我尝试在滚动器实例上设置cachePolicy =“on”。你应该将其设置为你的列表组件(或滚动条皮肤部分)
I have same problem. In google chrome we can see: The instruction at "0x00000000" referenced memory at "0x00000000". The memory could not be "written".
Solution: I tried to set cachePolicy="on" on my scroller instance. you should set this to your list component (or to scroller skin part)