ryanb
ryanb

Reputation: 159

Controlling the final size of a Sprite object

I'm rendering a xps file using flash (no MX or Spark), and I'm running into a sort of 'contradiction' that I'm unable to solve. [Note, that I'm trying to work only in core flash (e.g. Sprite, Shape, etc.), I've already solved (sort of) this issue using Spark.]

The pages of the xps file specify an explicit size. However, the content described (especially paths) in the xps file can sometimes extend outside of this area.

The problem is, I want the parent Sprite to have the size specified by the xps file, for example so scroll bars match the page size (not the sprite size), but in some cases the Sprite is much larger than this.

I've tried recursively going down and scaling everything UP, and then at the end scaling the parent container DOWN. Unfortunately, this causes translation problems with paths, and I assume it can also cause problems with bitmaps, etc.

Without using MX or Spark, is there anything I can do to control the size of the parent Sprite, other than scaling all the children independently?

cheers!

Upvotes: 0

Views: 117

Answers (1)

James Tomasino
James Tomasino

Reputation: 3581

I might be misreading what you're looking for, but you might find the solution by using the scrollRect property of your display object containers. If objects inside the container extend beyond the boundaries, they'll be clipped. You can still get to them by changing the x and y positions of the scrollRect. (link)

Upvotes: 1

Related Questions