1

Currently, I am creating a Flash application using ActionScript 3. My stage.scaleMode is set to StageScaleMode.SHOW_ALL, so that my app is automatically zoomed to fit contents of the stage.

The problem is I don't know how to get the current zoom percentage.

dayuloli
  • 16,205
  • 16
  • 71
  • 126
Kiran Shakya
  • 2,521
  • 2
  • 24
  • 37
  • 1
    Finally, I accomplished the same by alternative way. I instead of using, stage.scaleMode = StageScaleMode.SHOW_ALL, used stage.scaleMode = StageScaleMode.NO_SCALE and manually scaled the root to achieve zoom. Doing this, I now have zoomlevel known :). Hope this helps anyone with similar problem. – Kiran Shakya Apr 23 '14 at 12:04
  • I wonder if say `stage.scaleX` reading would return the correct zoom. You say you've searched, but did you try the stage's unusual implementation of these properties? – Vesper Apr 23 '14 at 12:08
  • 1
    @Vesper - unfortunately if using SHOW_ALL, the stage won't even know it is resized - there won't be resize event, and both width and scaleX would return the same values as the originals. It's pretty awkward behavior and I don't know who uses that :) – Andrey Popov Apr 23 '14 at 12:23

1 Answers1

2

StageScaleMode.SHOW_ALL is a bit tricky. I usually use NO_SCALE and manually do all the trick, pretty much like how it's done here.

Community
  • 1
  • 1
Andrey Popov
  • 7,362
  • 4
  • 38
  • 58