pic = "photo.jpg";
ox = mc_img_small._x;
oy = mc_img_small._y;
var l = new com_zszen.load.loadfile(mc_img_small, pic, {loadingbar: loadingbar, txt: "txt", point: 0, format: "loading. ll %"});
l.onLoad = function (ps)
{
};
l.onComplete = function ()
{
mc_img_small._visible = false;
};
l.onCompletePlus = function ()
{
var _l2 = mc_img_small._width;
var _l1 = mc_img_small._height;
mc_img_small._x = ox - _l2 / 2;
mc_img_small._y = oy - _l1 / 2;
mc_img_small._visible = true;
mc_img_small._alpha = 0;
com_zszen.spirit.moto.perTo(mc_img_small, "_alpha", 100, 4);
if (_l2 > 400 || _l1 > 400)
{
if (_l2 > _l1)
{
nw = 400;
nh = 400 * _l1 / _l2;
com_zszen.spirit.moto.perTo(mc_img_small, "_width", 400, 4);
com_zszen.spirit.moto.perTo(mc_img_small, "_height", 400 * _l1 / _l2, 4);
}
else
{
nh = 400;
nw = 400 * _l2 / _l1;
com_zszen.spirit.moto.perTo(mc_img_small, "_height", 400, 4);
com_zszen.spirit.moto.perTo(mc_img_small, "_width", 400 * _l2 / _l1, 4);
} // end if
com_zszen.spirit.moto.perTo(mc_img_small, "_x", ox - nw / 2, 4);
com_zszen.spirit.moto.perTo(mc_img_small, "_y", oy - nh / 2, 4);
} // end if
};
l.onError = function ()
{
};
l.load();
这代码我有些看不懂,没有使用Transition和Tween类方便