flash代码删除复制的影片剪辑
做了一个影片剪辑的复制并且拖动但是想做一个按钮可以删除复制出来的影片剪辑请问怎么写我写的removeMovieClip(_root._tempMC)但是只能删除最后拖出来...
做了一个影片剪辑的复制并且拖动 但是想做一个按钮可以删除复制出来的影片剪辑 请问怎么写
我写的removeMovieClip(_root._tempMC) 但是只能删除最后拖出来的这个 应该怎么写呢
var mcArr:Array = [];
var _clickX:Number;
var _clickY:Number;
var _tempMC:MovieClip;
mc2.onPress = function():Void{
_clickX = _xmouse;
_clickY = _ymouse;
_tempMC = this.duplicateMovieClip("mc" + getNextHighestDepth(), getNextHighestDepth());
_tempMC.startDrag();
_tempMC.onPress = function():Void{
this.startDrag();
}
_tempMC.onRelease = _tempMC.onReleaseOutside = function():Void{
stopDrag();
}
}
mc2.onRelease = mc.onReleaseOutside = function():Void{
if(_clickX + _clickY < 5){
_tempMC.removeMovieClip();
}
stopDrag();
} 展开
我写的removeMovieClip(_root._tempMC) 但是只能删除最后拖出来的这个 应该怎么写呢
var mcArr:Array = [];
var _clickX:Number;
var _clickY:Number;
var _tempMC:MovieClip;
mc2.onPress = function():Void{
_clickX = _xmouse;
_clickY = _ymouse;
_tempMC = this.duplicateMovieClip("mc" + getNextHighestDepth(), getNextHighestDepth());
_tempMC.startDrag();
_tempMC.onPress = function():Void{
this.startDrag();
}
_tempMC.onRelease = _tempMC.onReleaseOutside = function():Void{
stopDrag();
}
}
mc2.onRelease = mc.onReleaseOutside = function():Void{
if(_clickX + _clickY < 5){
_tempMC.removeMovieClip();
}
stopDrag();
} 展开
1个回答
2014-04-15
展开全部
var mcArr:Array = [];
var _clickX:Number;
var _clickY:Number;
var _mcArr:Array;
mc2.onPress = function():Void{
_clickX = _xmouse;
_clickY = _ymouse;
var _tempMC:MovieClip = this.duplicateMovieClip("mc" + getNextHighestDepth(), getNextHighestDepth());
_tempMC.startDrag();
_tempMC.onPress = function():Void{
this.startDrag();
}
_tempMC.onRelease = _tempMC.onReleaseOutside = function():Void{
stopDrag();
}
this._mc = _tempMC;
_mcArr.push(_tempMC);
}
mc2.onRelease = mc.onReleaseOutside = function():Void{
if(_clickX + _clickY < 5){
this._mc.removeMovieClip();
}
stopDrag();
}
移除按钮.onRelease = function():Void{
for(var i in _mcArr){
var _mc:MovieClip = _mcArr[i];
_mc.removeMovieClip();
}
_mcArr = [];
}
更多追问追答
追问
谢谢啊 我还是不行 郁闷
追答
var mcArr:Array = [];
var _clickX:Number;
var _clickY:Number;
var _mcArr:Array=[];
mc2.onPress = function():Void{
_clickX = _xmouse;
_clickY = _ymouse;
var _tempMC:MovieClip = this.duplicateMovieClip("mc" + getNextHighestDepth(), getNextHighestDepth());
_tempMC.startDrag();
_tempMC.onPress = function():Void{
this.startDrag();
}
_tempMC.onRelease = _tempMC.onReleaseOutside = function():Void{
stopDrag();
}
this._mc = _tempMC;
_mcArr.push(_tempMC);
}
mc2.onRelease = mc.onReleaseOutside = function():Void{
if(_clickX + _clickY < 5){
this._mc.removeMovieClip();
}
stopDrag();
}
移除按钮.onRelease = function():Void{
for(var i in _mcArr){
var _mc:MovieClip = _mcArr[i];
_mc.removeMovieClip();
}
_mcArr = [];
}
是我疏忽,打少了个 =[] 进行初始化
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询