Skip to main content
Participating Frequently
August 29, 2013
Question

How to restrict scaleX/scaleY to only either + or -ve axis while keeping the other end pos const?

  • August 29, 2013
  • 1 reply
  • 859 views

Hi,

I've been using scaleX for datagrid. However, it scale both in positive and negative X direction equally. I wish to keep one side of the datagrid as constant and only scale datagrid in negative x direction? Is there a way to limit scale to a +/-ve axis?

This topic has been closed for replies.

1 reply

Inspiring
August 29, 2013

scaling of DisplayObjects is dependend on where their registration point is located.

You should be able to move the registration point (indicated by the white dot in thge center of your object is you click on it) to the upper right corner.

Scaling should then happen around this point (insted of the center)

[Not tested if their are any limitations with components]

maulshreAuthor
Participating Frequently
August 29, 2013

Thanks. but that would be hardcoding as i want to limit scale in different axis based on different 'if' conditions in as3..... is there a way to do such restrained scaling programmatically?

Inspiring
August 29, 2013

If you ask if there is a direct way to set the registraion point with code? as far as I know, no.

There are some solutions like the TransformMananger from Greensock, who pretty much works around this issue.

http://www.greensock.com/tweenmax/