我正在尝试加载一个大约3000x2000像素的大图像,然后用一个小正方形遮罩它,这样以后我就可以滚动查看图像了。
createEmptyMovieClip("container", getNextHighestDepth());
container.createEmptyMovieClip("fullImage", container.getNextHighestDepth());
//When I replace the above line of code with the line of code bellow the image is displayed but it still not masked.
//createEmptyMovieClip("fullImage", getNextHighestDepth());
var fullClipLoader = new MovieClipLoader();
fullClipLoader.loadClip("fountain.jpg", fullImage);
// Function for scrolling through the image
fullClipLoader.onLoadComplete = function() {
createEmptyMovieClip("mask", getNextHighestDepth());
mask._x = 50;
mask._y = 50;
mask.beginFill(0xFF0000,50);
mask.lineStyle(5,0xFF00FF,100);
mask.lineTo(100,0);
mask.lineTo(100,100);
mask.lineTo(0,100);
mask.lineTo(0,0);
container.setMask(mask);
/*
fullImage._x += _level0._xmouse;
if (fullImage._x>_level0._x) {
fullImage._x = _level0._x;
}
if (fullImage._x<(_level0._x-(fullImage._width-_level0._width))) {
fullImage._x = _level0._x-(fullImage._width-_level0._width);
}
*/
};