A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Scale a rectangle from center

Threaded View

  1. #1
    Junior Member
    Join Date
    Dec 2010
    Posts
    2

    Scale a rectangle from center

    hello,

    i have a simple rectangle.
    i would like to scale it to 200 but the scaling always begins from top-left corner of the rectangle.
    how can i scale it from the center?
    thank you!

    Actionscript Code:
    rect.onPress = mousePress;
    rect.onRelease = mouseRelease;
    function mousePress():Void {
        var item:MovieClip = this;
        item._xscale = item._yscale = 200;
    }
    function mouseRelease():Void {
        var item:MovieClip = this;
        item._xscale = item._yscale = 100;
    }
    Attached Files Attached Files
    Last edited by belo; 12-08-2010 at 01:41 PM.

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