In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

sclae9Grid

http://help.adobe.com/ko_KR/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b8e309-7fdd.html
Get Adobe Flash player
by SkywaveTM 17 Jul 2011
    Embed
/**
 * Copyright SkywaveTM ( http://wonderfl.net/user/SkywaveTM )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/uxmI
 */

//click RoundRect to resize to see the differance between 'with scale9Grid' and 'without scale9Grid'

/*
으으 안한지 몇일이나 됬다고 벌써 다까먹어서 완전 헤멤...
여튼 scale9Grid는 싱기한 기능이긴 한데 RoundRect을 쓰지 않는 이상 별 필요는 없을듯...

뭐 대부분의 알림창이 가장자리가 둥글고, 역동적으로 크기를 변환시키며 등장할때는 잘써먹겠지만.
*/
package {
    import flash.geom.Rectangle;
    import flash.events.MouseEvent;
    import flash.display.Shape;
    import flash.display.Sprite;
    import flash.display.Graphics;
    public class FlashTest extends Sprite {
        public function FlashTest() {
            
                        
            var shape1:Sprite = new Sprite();
            shape1.graphics.beginFill(0x000000, 1);
            shape1.graphics.drawRoundRect(0,0,400,200,50,50);
            
            var shape2:Sprite = new Sprite();
            shape2.graphics.beginFill(0x000000, 1);
            shape2.graphics.drawRoundRect(0,0,400,200,50,50);
            
            this.addChild(shape1);
            this.addChild(shape2);
            shape2.y = 220;
            
            shape1.addEventListener(MouseEvent.CLICK, resizea);
            
            function resizea():void{
                shape1.scale9Grid = new Rectangle(50,50,300,100);
                shape1.scaleY = 0.7;
                shape1.scaleX = 0.3;
            }
            
            
            shape2.addEventListener(MouseEvent.CLICK, resizeb);
            
            function resizeb():void{
                shape2.scaleY = 0.7;
                shape2.scaleX = 0.3;
            }

            
        }
    }
}