今天遇到一个很奇怪的问题..我用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才可以?