我已将 AS2 swf 加载到 AS3 swf 中,但 MovieClipLoader 对象的 onLoadInit 函数未执行;这使我的图像没有居中并且没有缩小尺寸(宽度/高度)
如果我直接运行 AS2 swf(图库),它就可以工作。
listenerObj.onLoadInit = function (target:MovieClip) {
if (target._height > _root.maxHeight)
{
var ratio = target._height / _root.maxHeight;
target._height = target._height/ratio;
target._width = target._width/ratio;
}
if (target_mc._width > _root.maxWidth)
{
var ratio = target._width / _root.maxWidth;
target._height = target._height/ratio;
target._width = target._width/ratio;
}
target._x = ((Stage.width/2)-(target._width/2));
target._y = ((Stage.height/2)-(target._height/2));
}
MCL.addListener(listenerObj);