A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Scaling and Registration Point

  1. #1
    Senior Member
    Join Date
    Aug 2000
    Location
    Desert Southwest
    Posts
    367

    Scaling and Registration Point

    I have two rectangle shapes. If I change the scaleX of one of the rectangle shapes, it appears that it is scaling from the middle registration point rather than 0,0. I am just transitioning into AS3, so I am sure that it is something I am overlooking.

    Here's my code:
    Code:
    var bg:Shape = new Shape()
    bg.graphics.beginFill(0xcccccc,1);
    bg.graphics.lineStyle(1,0x000000);
    bg.graphics.drawRect(50,50,200,10)
    bg.graphics.endFill();
    addChild(bg);
    			
    var bar:Shape = new Shape();
    bar.graphics.beginFill(0x990000,100);
    bar.graphics.drawRect(50,40,200,10)
    bar.graphics.endFill();
    addChild(bar);
    bar.scaleX=.5
    Thanks for any and all replies

  2. #2
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,045
    it's scaling from 0,0, but your rectangle isn't being drawn on 0,0, its being drawn at 50,50, and 50,40 respectively.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center