打开一个FLASH后,在场景中,有个动作层,找到编译软件,发现了如下的代码。
stop ();
var sign_Loader = new MovieClipLoader();
show_pic_Listener = new Object();
show_pic_Listener.onLoadProgress = function (target_mc, loadedBytes, totalBytes)
{
looo._visible = 1;
lo._visible = 1;
lb = Math.round(loadedBytes / totalBytes * 100);
box.loader = lb + " %";
looo_2._visible = 1;
};
show_pic_Listener.onLoadInit = function (target_mc)
{
box.loader = " ";
box.pic.gotoAndPlay(2);
};
sign_Loader.addListener(show_pic_Listener);
bas_x = box._x;
allow = 1;
onEnterFrame = function ()
{
if (allow == 1)
{
box._x = box._x + (132 - box._x) / 5;
if (box._x >= 131)
{
box._x = 132;
allow = 2;
} // end if
} // end if
if (allow == 2)
{
sign_Loader.loadClip("magic/1.jpg", box.pic.mc);
allow = 0;
} // end if
if (allow == 3)
{
box._x = box._x + (bas_x - box._x) / 5;
if (box._x <= bas_x + 1)
{
_parent.mcloader.loadClip(_parent.vod, _parent.mc);
allow = 0;
} // end if
} // end if
};
谁能帮我解释一下这个代码什么意思,完成什么样的操作。
谢谢了。
stop ();
var sign_Loader = new MovieClipLoader();
show_pic_Listener = new Object();
show_pic_Listener.onLoadProgress = function (target_mc, loadedBytes, totalBytes)
{
looo._visible = 1;
lo._visible = 1;
lb = Math.round(loadedBytes / totalBytes * 100);
box.loader = lb + " %";
looo_2._visible = 1;
};
show_pic_Listener.onLoadInit = function (target_mc)
{
box.loader = " ";
box.pic.gotoAndPlay(2);
};
sign_Loader.addListener(show_pic_Listener);
bas_x = box._x;
allow = 1;
onEnterFrame = function ()
{
if (allow == 1)
{
box._x = box._x + (132 - box._x) / 5;
if (box._x >= 131)
{
box._x = 132;
allow = 2;
} // end if
} // end if
if (allow == 2)
{
sign_Loader.loadClip("magic/1.jpg", box.pic.mc);
allow = 0;
} // end if
if (allow == 3)
{
box._x = box._x + (bas_x - box._x) / 5;
if (box._x <= bas_x + 1)
{
_parent.mcloader.loadClip(_parent.vod, _parent.mc);
allow = 0;
} // end if
} // end if
};
谁能帮我解释一下这个代码什么意思,完成什么样的操作。
谢谢了。
onEnterFrame = function (){} //设置box做标,并相应的加载文件到相应的MC(比如图片)