Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Community Beginner ,
Aug 29, 2013 Aug 29, 2013

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?

TOPICS
ActionScript
831
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Aug 29, 2013 Aug 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]

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 29, 2013 Aug 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Aug 29, 2013 Aug 29, 2013
LATEST

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/

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines