外部 as2 swf 的预加载器
我所需要的只是一个要运行的预加载器,当它检测到 swf 已加载时,它将停止并且 map.swf 将开始运行。我已经在网上搜寻了几个星期,但没有运气。我有一个巨大的 776kb flash 地图。我需要一个预加载器在此地图之前运行,但它需要是独立于 map.swf 的预加载器。请问有人有什么想法吗?我真的很感激一些帮助。提前致谢
all i need is a preloader to run and when it detects the swf is loaded it will stop and the map.swf will start to run. I have trawled the net for weeks with no luck. I have a massive 776kb flash map. I need a preloader to run prior to this map but it need to be a preloader independant of the map.swf. Please does anyone have any ideas at all. i really would appreciate some help. thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,找到了:http://actionscripts。 org/forums/showthread.php3?t=74988&highlight=preloader+tutorial+MX+2004
//-----
//-------------预加载器------
//使预加载器栏不会立即显示为“满”
bar_mc._xscale = 0;
//将电影加载到级别 1
loadMovieNum("yourMovie.swf", 1);
//请注意要加载的影片有一个空白的第一帧。
_level1.stop();
onEnterFrame = 函数 () {
// 获取 Level 1 的字节并转化为百分比
百分比 = Math.ceil((_level1.getBytesLoaded()/_level1.getBytesTotal())*100);
//使用百分比来确定预加载器栏的xscale。
bar_mc._xscale = 百分比;
// 如果加载则播放 level1
如果(百分比>99){
//注意你必须删除onEnterFrame否则它
//将继续运行并永远只播放第2帧。
删除this.onEnterFrame;
_level1.gotoAndPlay(2);
};
okay found it:http://actionscripts.org/forums/showthread.php3?t=74988&highlight=preloader+tutorial+MX+2004
//-----
//-------------preloader------
//make the preloader bar not appear "full" right away
bar_mc._xscale = 0;
//load Movie into level 1
loadMovieNum("yourMovie.swf", 1);
//please note the movie to load has a blank first frame.
_level1.stop();
onEnterFrame = function () {
// get the bytes of Level 1 and make into a percent
percent = Math.ceil((_level1.getBytesLoaded()/_level1.getBytesTotal())*100);
//use the percent to determine the xscale of the preloader bar.
bar_mc._xscale = percent;
// if loaded play level1
if (percent>99) {
//note you MUST delete onEnterFrame otherwise it
//will continue to run and play just frame 2 forever.
delete this.onEnterFrame;
_level1.gotoAndPlay(2);
};