1

How can I set a range in AS3 for value of (for example) width of my screen? What I mean is I have this piece of code:

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

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

and my movie starts only if it's width more than 650 px. What I don't know is how to set a range of values, something like this: 250<.width<650, so my movie will start only if it's width between this numbers.

Peter Elliott
  • 3,273
  • 16
  • 30
be well
  • 325
  • 2
  • 14

1 Answers1

1
if (stage.loaderInfo.width < 650 && stage.loaderInfo.width > 250) {
    play();
} else {
    gotoAndStop(1);
}

You'll have to call the function at some sort of interval, either by event or by enterframe.

Atriace
  • 2,572
  • 1
  • 14
  • 27