我想点击按钮mini1 pic1后转到页面中心并更改尺寸...这段代码工作正常,但我想动态改变大小和位置......我能否以某种方式更改此代码实现调整图像大小的效果,或者我必须通过补间动画来做到这一点......?
mini1.addEventListener(MouseEvent.CLICK, show1);
function show1(event:MouseEvent):void
{
pic1.visible = true;
if (pic1.y > 440) {
pic1.y -= 270;
pic1.x = 300;
pic1.width = 400;
pic1.height = 400;
}
pic2.visible = false;
pic3.visible = false;
pic4.visible = false;
}
答案 0 :(得分:1)
尝试
pic1.width = 400;
pic1.height = 400;
pic1.x = stage.stageWidth-pic1.width;
pic1.y = stage.stageHeight-pic1.height;
请注意,在调整图片大小后, x 和 y 属性需要更改