从 xml 中提取的 As2 jpg 预加载器
我正在尝试构建一个简单的预加载器。我在舞台上有 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 有点重,我想预加载它们。这可能吗?
I am trying to build a simple preloader. I have 4 movieclips on stage and on each one i am adding an image that comes from an xml file
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");
everything works ok but as the jpgs are a bit heavy i'd like to preload them. Is that possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)