【发布时间】:2010-10-24 10:11:24
【问题描述】:
这似乎是一件很容易做到的事情,但它让我很头疼。我有一个作为画廊的影片剪辑,当单击按钮时,它被链接为从 AS 调用。当单击图库中的图像时,它会使用 Tween 类淡入淡出,并且应该在主舞台上居中,但它以movieClip为中心。
代码如下:
//Centers and places image right ondo the display board
function fullLoaded(e:Event):void {
var myFull:Loader = Loader(e.target.loader);
addChild(myFull);
//positioning
myFull.x = (stage.stageWidth - myFull.width) / 2;
myFull.y = (stage.stageHeight - myFull.height) /2;
//register the remove function
myFull.addEventListener(MouseEvent.CLICK, removeFull);
new Tween(myFull, "alpha", Strong.easeInOut,0,1,0.5,true);
}
我尝试了所有这些组合都无济于事:
MovieClip(root).stage.stageWidth
root.stage.stageWidth
parent.stage.stageWidth
这些都没有将图像放在正确的位置。
【问题讨论】:
-
嗨,您检查过
stage.align属性吗? -
是的,我也试过了,但没有成功:(
标签: flash actionscript-3 web-applications stage