ActionScript组件Button

今天遇到一个很奇怪的问题..我用cs 3的组件Button.名字是btnFirst

然后再参数中,设置了一下lable="";为空!改了一下button的select_down的样式(自己手动修改的颜色)

在ActionScript写了一个构造方法

package {
 import flash.display.MovieClip;
 import flash.display.Loader;
 import flash.net.URLLoader;
 import flash.net.URLRequest;
 import flash.events.MouseEvent;
 import flash.events.Event;
 import fl.events.ComponentEvent;
 
 public class test extends MovieClip {

      public function test()

     {

                btnFirst.visible=false;

     }

}

发现再swf中btnFirst还是显示的。

 

试了半天发现重新加入一个新的button就可以,但是修改的样式就没有。

后来我拿了两个button一个是改了的btnFirst,另外一个是btnSecond(工具自带的)

package {
 import flash.display.MovieClip;
 import flash.display.Loader;
 import flash.net.URLLoader;
 import flash.net.URLRequest;
 import flash.events.MouseEvent;
 import flash.events.Event;
 import fl.events.ComponentEvent;
 
 public class test extends MovieClip {

      public function test()

     {

                btnFirst.visible=false;

               btnSecond.visible=false;

     }

}

奇怪的是btnSecond确实隐藏了,btnFirst还在.

最后我就再lable参数中加入Label(组件默认值)可以了。

郁闷的是为什么再label参数中随便写还不行,必须写成Label才可以?

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值