flash AS3中,点击按钮鼠标变形,部分按钮失效,再次点击后鼠标复原,且失效按钮可用,脚本怎么写?
Object(this).maocao_btn.addEventListener(MouseEvent.MOUSE_DOWN,shubiao);functionshubi...
Object(this).maocao_btn.addEventListener(MouseEvent.MOUSE_DOWN,shubiao);
function shubiao(evt:MouseEvent) {
Mouse.hide();
Object(this).maocao_mc.startDrag(true);
}
鼠标变形已实现,其他的不知道怎么写? 展开
function shubiao(evt:MouseEvent) {
Mouse.hide();
Object(this).maocao_mc.startDrag(true);
}
鼠标变形已实现,其他的不知道怎么写? 展开
展开全部
你是要点击变形还是按下变形 目前你写的是鼠标按下变形 而不是点击 只不过你没写mouse_up的事件,所有现在实现的效果跟点击一样,如果你是要按下 写歌mouse_up事件就好 如果是点击 就做下判断就好了。看下面两个吧 1 2 3为你说的其他的按钮
按下:
Object(this).maocao_btn.addEventListener(MouseEvent.MOUSE_DOWN,shubiao);
Object(this).maocao_btn.addEventListener(MouseEvent.MOUSE_UP,up);
function shubiao(evt:MouseEvent) {
Mouse.hide();
Object(this).maocao_mc.startDrag(true);
1.mouseEnable = false;
2.mouseEnable = false;
3.mouseEnable = false;
}
function up(evt:MouseEvent) {
Mouse.show();
Object(this).maocao_mc.stopDrag(true);
1.mouseEnable = true;
2.mouseEnable = true;
3.mouseEnable = true;
}
点击:
Object(this).maocao_btn.addEventListener(MouseEvent.CLICK,shubiao);
function shubiao(evt:MouseEvent) {
if(1.mouseEnable){
Mouse.hide();
Object(this).maocao_mc.startDrag(true);
1.mouseEnable = false;
2.mouseEnable = false;
3.mouseEnable = false;
}else{
Mouse.show();
Object(this).maocao_mc.stopDrag(true);
1.mouseEnable = true;
2.mouseEnable = true;
3.mouseEnable = true;
}
}
按下:
Object(this).maocao_btn.addEventListener(MouseEvent.MOUSE_DOWN,shubiao);
Object(this).maocao_btn.addEventListener(MouseEvent.MOUSE_UP,up);
function shubiao(evt:MouseEvent) {
Mouse.hide();
Object(this).maocao_mc.startDrag(true);
1.mouseEnable = false;
2.mouseEnable = false;
3.mouseEnable = false;
}
function up(evt:MouseEvent) {
Mouse.show();
Object(this).maocao_mc.stopDrag(true);
1.mouseEnable = true;
2.mouseEnable = true;
3.mouseEnable = true;
}
点击:
Object(this).maocao_btn.addEventListener(MouseEvent.CLICK,shubiao);
function shubiao(evt:MouseEvent) {
if(1.mouseEnable){
Mouse.hide();
Object(this).maocao_mc.startDrag(true);
1.mouseEnable = false;
2.mouseEnable = false;
3.mouseEnable = false;
}else{
Mouse.show();
Object(this).maocao_mc.stopDrag(true);
1.mouseEnable = true;
2.mouseEnable = true;
3.mouseEnable = true;
}
}
追问
那再次点击maocao_btn后鼠标恢复怎么实现?
追答
就这意思 自己学学 光问是不会的 照葫芦画瓢总应该会吧
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询