加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Flash AS3切换可见

发布时间:2020-12-15 07:22:28 所属栏目:百科 来源:网络整理
导读:我有一个脚本,一旦点击(按钮)一些其他东西隐藏然后再次点击它重新显示.问题是一旦隐藏它永远不再显示这里是脚本: menu_start.addEventListener(MouseEvent.CLICK,myClickFunction);function myClickFunction(event:MouseEvent) { // Hide the first and sho
我有一个脚本,一旦点击(按钮)一些其他东西隐藏然后再次点击它重新显示.问题是一旦隐藏它永远不再显示这里是脚本:

menu_start.addEventListener(MouseEvent.CLICK,myClickFunction);


function myClickFunction(event:MouseEvent) {

      // Hide the first and show the next here
      if (menu_menu.visible == true){
      menu_menu.visible = false;

      } 
      if (menu_menu.visible == false) {
          menu_menu.visible == true;
      }

}

非常感谢.

解决方法

The reason is when you click on the
button,it does hide but again when
you click on the same button it does
not show back

如果我在上述陈述中错了,请纠正我.

现在尝试一下我说的话,有两个按钮隐藏和显示.创建两个新函数并尝试一下,如果这样有效,那么你的逻辑中就会缺少一些东西,如果这不起作用那么请告诉我们.

也试试这个.

function myClickFunction(event:MouseEvent) {

      // Hide the first and show the next here
      if (menu_menu.visible){
      menu_menu.visible = false;

      } else {
         menu_menu.visible = true;
      }

}

另一个问题可能是,当你点击按钮可能是它没有再次获取menu_menu属性作为其隐藏或销毁.它是在同一个组件内还是从其他地方调用?

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读