【问题标题】:Set min and max width of Rectangle设置矩形的最小和最大宽度
【发布时间】:2013-03-28 15:34:07
【问题描述】:

如何在 AS3 中设置屏幕宽度(例如)值的范围? 我的意思是我有这段代码:

var myBounds:Rectangle=this.getBounds(stage);
if ((myBounds.width>650)&&(visibleArea.intersects(myBounds)))
{

  if(this.currentFrame==1)
     this.play();
}
else
{
    this.gotoAndStop(1);
}
return;

我的电影只有在宽度超过 650 像素时才会开始。 我不知道如何设置一系列值,如下所示: 250<.width>

【问题讨论】:

    标签: actionscript-3 prezi


    【解决方案1】:
    if (stage.loaderInfo.width < 650 && stage.loaderInfo.width > 250) {
        play();
    } else {
        gotoAndStop(1);
    }
    

    您必须以某种时间间隔调用该函数,无论是按事件还是按 Enterframe。

    【讨论】:

    • 谢谢你,我做到了。
    • 太棒了。不要忘记接受答案,以便其他人知道问题已解决。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-30
    • 2012-11-13
    • 2021-04-06
    • 2018-11-08
    • 1970-01-01
    相关资源
    最近更新 更多