0

我想在单击按钮 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;
}
4

1 回答 1

1

尝试

pic1.width = 400;
pic1.height = 400;
pic1.x = stage.stageWidth-pic1.width;
pic1.y = stage.stageHeight-pic1.height;

请注意,在调整图像大小后xy属性需要更改

于 2013-06-12T21:28:53.717 回答