4 Replies - 2170 Views - Last Post: 18 March 2012 - 03:00 PM

#1 Mylo  Icon User is offline

  • Knows all, except most.

Reputation: 265
  • View blog
  • Posts: 747
  • Joined: 11-October 11

Hiding items outside main area?

Posted 18 March 2012 - 04:45 AM

I noticed when you stretch out a flash application (at least those I've come across) you can start to see more than what was originally visible. Is there a way to have it stay proportional to the size of the frame?

Also, is there a feature in flash that allows you to trim off all the parts that fall outside the main area?
Is This A Good Question/Topic? 0
  • +

Replies To: Hiding items outside main area?

#2 chinchang  Icon User is offline

  • Indie Game Developer
  • member icon

Reputation: 192
  • View blog
  • Posts: 725
  • Joined: 22-December 08

Re: Hiding items outside main area?

Posted 18 March 2012 - 08:01 AM

You can do 2 things:

1. If you are okay with your content getting scaled, you can set the stage scale mode to EXACT_FIT:

stage.scaleMode=StageScaleMode.SHOW_ALL;




2. Or if you want the content to remain as it is, you can set the scale mode to NO_SCALE and add a mask to your stage so that only the area covered by the mask is visible:


stage.scaleMode=StageScaleMode.NO_SCALE;
// stage_mask is a rectangle of the size of your stage
stage.mask = stage_mask;


Was This Post Helpful? 1
  • +
  • -

#3 Mylo  Icon User is offline

  • Knows all, except most.

Reputation: 265
  • View blog
  • Posts: 747
  • Joined: 11-October 11

Re: Hiding items outside main area?

Posted 18 March 2012 - 12:28 PM

EXACT_FIT is perfect =)

Although I'm not really familiar with actionscript, I wasn't able to get the second suggestion working however. I get the error message:

Scene 1, Layer 'Layer 6', Frame 1, Line 3 1120: Access of undefined property stage_mask.

Actually, I get this same error with a lot of code. I'm using action scipt 3.0 if that makes a difference.

Thankyou, animation looks much better now.
Was This Post Helpful? 0
  • +
  • -

#4 GreenSpiral  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 64
  • Joined: 30-December 08

Re: Hiding items outside main area?

Posted 18 March 2012 - 02:31 PM

You need to create the rectangle. In the example chinchang gave, the name of the rectangle was stage_mask.
Was This Post Helpful? 1
  • +
  • -

#5 Mylo  Icon User is offline

  • Knows all, except most.

Reputation: 265
  • View blog
  • Posts: 747
  • Joined: 11-October 11

Re: Hiding items outside main area?

Posted 18 March 2012 - 03:00 PM

Ah, my mistake. I looked at it so many times, yet the comment completely slipped my mind. Thank you.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1