当滚动“太”时 Horizo​​ntalList 崩溃快速地

发布于 2024-11-03 16:16:30 字数 2161 浏览 2 评论 0原文

我在 Flex(Flash Builder 4) 中遇到这个奇怪的问题,在 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);
        }
    }
}

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

对你而言 2024-11-10 16:16:36

我有同样的问题。在 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)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文