将加载的内容放在特定深度(通过 MovieClipLoader 的 loadClip)和顶部的“阻塞器”透明 MovieClip(getNextHighestDepth())以及一个空的按下/释放处理程序,您可以在不需要时将其 _visible 属性设置为 false 怎么样?
这是一个基本示例:
var loadedContent:MovieClip = createEmptyMovieClip("loadedContent",getNextHighestDepth());
var loader:MovieClipLoader = new MovieClipLoader();
loader.loadClip("as2loadee.swf",loadedContent);//loads content on _level0, unlike loadMovieNum
var blocker:MovieClip = createEmptyMovieClip("blocker",getNextHighestDepth());
blocker.beginFill(0,0);//transparent fill
drawRect(blocker,0,0,100,100);//these values might change
blocker.endFill();
blocker.onPress = function():Void{
trace("nuh-uh!");
}
function drawRect(target:MovieClip,x:Number,y:Number,w:Number,h:Number):Void{
target.lineTo(x ,y );
target.lineTo(x+w,y );
target.lineTo(x+w,y+h);
target.lineTo(x ,y+h);
target.lineTo(x ,y );
}