Flex Mobile s:List item click Callout

FLEXible guys I have a little problem and need some suggestions from professionals in flex. I've a Spark List component in my flex mobile project and I've added a Callout component when user clicks on list item - it generates a new callout component and opens it. But in my case (I've tested it on iPad) it works when user clicks on list but it crashes when user double clicks (at list double) on list - its because of Creation and Adding event listeners to callout component etc. when user double clicks on list it tries to create a callout and at the same time close it as MOUSE_DOWN_OUTSIDE is triggered (its not a case in simulators because of better CPU performance). So how can I construct it to be error free - or any better advantage of callout to show details of list item. Here's my code:

    <fx:Script>
            <![CDATA[
                public var clInfo:Callout;

                protected function lst_tetkikler_clickHandler(event:MouseEvent):void
                {
                    if(lst_tetkikler.selectedItem != null){
                        clInfo = new Callout();
                        clInfo.width = 400;
                        clInfo.setStyle("contentBackgroundColor",0xf8eabd);

                        lbl_adet.text = lst_tetkikler.selectedItem['adet'];
                        lbl_puan.text = lst_tetkikler.selectedItem['puan'];

                        clInfo.addElement(vg_info);
                        clInfo.verticalPosition = "after";
                        clInfo.open(lst_tetkikler.dataGroup.getElementAt(lst_tetkikler.selectedIndex) as DisplayObjectContainer,true);
                        clInfo.addEventListener(FlexMouseEvent.MOUSE_DOWN_OUTSIDE, closeComponent);
                    }

                }

                protected function closeComponent(event:FlexMouseEvent):void
                {
                    if(clInfo){
                        clInfo.removeEventListener(FlexMouseEvent.MOUSE_DOWN_OUTSIDE, closeComponent);
                        clInfo.close(); 
                        clInfo = null;
                    }
                }


            ]]>
        </fx:Script>

    <s:List id="lst_tetkikler" width="100%" height="50%" 
                dataProvider="{listTetkik}" contentBackgroundAlpha="0" 
                visible="{!(listTetkik.length==0)}" 
                labelField="tetAdi" color="#314F83" 
                click="lst_tetkikler_clickHandler(event)"
                >
        </s:List>

Any suggestions?


我已经解决了在CalloutButton组件下添加所有标注内容的问题 - 看起来Adobe团队仅在标注按钮的情况下考虑了这些情况 - 动态创建类似上述场景的标注会崩溃

链接地址: http://www.djcxy.com/p/34664.html

上一篇: 在HTML中创建垂直堆叠的项目组,如VGroup

下一篇: Flex Mobile s:列表项单击标注