我正在通过 AS3 将图像加载到影片剪辑中,而我想要做的是将图像居中放置在影片剪辑中。问题是我似乎无法获取正在加载的图像的宽度值。以下是我正在做的事情:
imageLoader = new Loader();
imageLoader.load(new URLRequest(event.target.name));
screenBox.screenHolder.addChild(imageLoader);
trace(this.imageLoader.width);
当我跟踪宽度时,即使 imageLoader 中有图像,它也总是返回零(0)。我需要做什么才能找到实际宽度,以便我可以使图像居中?