作者afu70 ()
看板Flash
标题Re: [问题] 影片深度的问题
时间Sat Sep 30 05:37:30 2006
试了一下 不知道这是不是你要的
先设三个元件a_mc, b_mc, mask_mc
一开始设定好他们的深度
之後用onPress与onRelease去改变他的深度:
a_mc.swapDepths(0)
b_mc.swapDepths(1)
mask_mc.swapDepths(2)
a_mc.onPress=function(){
this.swapDepths(3)
}
a_mc.onRelease=function(){
this.swapDepths(0)
}
b_mc.onPress=function(){
this.swapDepths(3)
}
b_mc.onRelease=function(){
this.swapDepths(1)
}
每个深度都是只能存放一个物件
深度相同 前面设定的消失
如果物件过多难以管理深度的话
用getNextHighestDepth()可以防止这样的事发生
(MX2004以後的版本才有此项功能):
a_mc.swapDepths(getNextHighestDepth())
b_mc.swapDepths(getNextHighestDepth())
mask_mc.swapDepths(getNextHighestDepth())
a_mc.onPress=function(){
this.swapDepths(getNextHighestDepth())
}
a_mc.onRelease=function(){
mask_mc.swapDepths(getNextHighestDepth())
}
b_mc.onPress=function(){
this.swapDepths(getNextHighestDepth())
}
b_mc.onRelease=function(){
mask_mc.swapDepths(getNextHighestDepth())
}
※ 引述《dlan (dlan)》之铭言:
: 我用swapDepths(1)和按钮 on(press)
: 去设定影片的深度(好像会使影片跳脱图层和时间轴的深度)
: 但是放开按钮时
: 要还原影片原本的深度(跳回原本影片所对应的图层和时间轴的深度)
: 用swapDepths(0)也没办法
: 有其他的方法吗??
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 59.112.162.176