Flex 3 PopUpMenuButton 和 ReferenceError #1069

发布于 2024-09-24 20:24:23 字数 1027 浏览 4 评论 0原文

我在 Flex 3 应用程序中有一个 PopUpMenuButton。如果有人点击下拉部分,它就可以正常工作。但是,如果他们点击主按钮部分,我就会得到 获取引用错误:错误#1069。用户消除错误后,它就会执行其应该执行的操作。

<mx:PopUpMenuButton
    id="myPopUpMenuButton2"
    label="Flip"
    labelField="@label"
    dataProvider="{myList2}" 
    itemClick="popUpMenuButtonClickHandler2(event);flipperPhotoSearcher1(event.item.@neigborhoodNum, event.item.@imageSeries);"
    click="defaultpopUpMenuButtonClickHandler2()"
/>


public function popUpMenuButtonClickHandler2(event:MenuEvent):void {
        mainViewStack.selectedChild = this[event.item.@chosen];
        myPopUpMenuButton2.label = event.item.@label;
        neighborhoodPopUpMenuButton.label = "Neighborhoods";
    }  


public function defaultpopUpMenuButtonClickHandler2():void {
        mainViewStack.selectedChild = home;
        myPopUpMenuButton2.label = 'Adams Morgan';
        flipperPhotoSearcher1(2,1);
        neighborhoodPopUpMenuButton.label = "Neighborhoods";
    }   

关于我做错了什么有什么想法吗?

谢谢。

-拉克斯米迪

I've got a PopUpMenuButton in a Flex 3 application. If someone clicks on the pulldown part, it works fine. But, if they click on the main button part, I get
get ReferenceError: Error #1069. After the user dismisses the error, it then does what it's supposed to do.

<mx:PopUpMenuButton
    id="myPopUpMenuButton2"
    label="Flip"
    labelField="@label"
    dataProvider="{myList2}" 
    itemClick="popUpMenuButtonClickHandler2(event);flipperPhotoSearcher1(event.item.@neigborhoodNum, event.item.@imageSeries);"
    click="defaultpopUpMenuButtonClickHandler2()"
/>


public function popUpMenuButtonClickHandler2(event:MenuEvent):void {
        mainViewStack.selectedChild = this[event.item.@chosen];
        myPopUpMenuButton2.label = event.item.@label;
        neighborhoodPopUpMenuButton.label = "Neighborhoods";
    }  


public function defaultpopUpMenuButtonClickHandler2():void {
        mainViewStack.selectedChild = home;
        myPopUpMenuButton2.label = 'Adams Morgan';
        flipperPhotoSearcher1(2,1);
        neighborhoodPopUpMenuButton.label = "Neighborhoods";
    }   

Any ideas as to what I'm doing wrong?

Thank you.

-Laxmidi

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

沉睡月亮 2024-10-01 20:24:23

在代码的 MXML 部分中,单击处理程序必须传递一个事件参数,就像 itemClick 事件处理程序一样。

click="defaultpopUpMenuButtonClickHandler2()"
should be...
click="defaultpopUpMenuButtonClickHandler2(event)"
or, you could do this...
click="defaultpopUpMenuButtonClickHandler2(null)"

但您的处理程序应该接收 MouseEvent 类型的事件,而不是 ItemClick。

public function defaultpopUpMenuButtonClickHandler2():void {
should be...
public function defaultpopUpMenuButtonClickHandler2(event:MouseEvent):void {

天气 null 是否通过。

In the MXML portion of your code, the click handler must pass an event argument just like the itemClick event handler has.

click="defaultpopUpMenuButtonClickHandler2()"
should be...
click="defaultpopUpMenuButtonClickHandler2(event)"
or, you could do this...
click="defaultpopUpMenuButtonClickHandler2(null)"

but your handler should receive the event as a MouseEvent type, not ItemClick.

public function defaultpopUpMenuButtonClickHandler2():void {
should be...
public function defaultpopUpMenuButtonClickHandler2(event:MouseEvent):void {

weather null is passed or not.

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