我正在尝试构建一个简单的预加载器。我在舞台上有 4 个影片剪辑,在每个影片剪辑上我都添加了一个来自 xml 文件的图像
theMap = new XML();
theMap.ignoreWhite = true;
theMap.onLoad = function(success){
if (success) {
theNodes = theMap.firstChild.childNodes;
for (i=0;i < theNodes.length;i++) {
theSrc = theNodes[i].attributes.src; //the jpg
theClip = theNodes[i].attributes.clip; //the movieclip
_root[theClip].loadMovie(theSrc); // adding the jpg to the movieclip
}
}
else {
trace('Cannot Load XML file.');
}
}
theMap.load("map.xml");
一切正常,但由于 jpg 有点重,我想预加载它们。那可能吗?