{"id":49,"date":"2008-09-16T02:07:33","date_gmt":"2008-09-16T00:07:33","guid":{"rendered":"https:\/\/interactive-developer.com\/blog\/?p=49"},"modified":"2018-05-08T22:31:37","modified_gmt":"2018-05-08T20:31:37","slug":"scale9grid-with-masking","status":"publish","type":"post","link":"https:\/\/ixdc.net\/blog\/2008\/09\/16\/scale9grid-with-masking\/","title":{"rendered":"Scale9Grid with Masking"},"content":{"rendered":"<p>ActionScript DisplayObject has a property called scale9grid used to scale objects according to nine regions based rectangle, detailed information could be found <a href=\"https:\/\/livedocs.adobe.com\/flash\/9.0\/ActionScriptLangRefV3\/flash\/display\/DisplayObject.html#scale9Grid\" target=\"_blank\"><span style=\"color: #EF6596;\">here<\/span><\/a><\/p>\n<p>One day I was trying to use it for scaling effect applied to a MovieClip with curved corners and dynamic loaded image within, the problem was that the mask didn&#8217;t scale properly using scale9grid ..<br \/>\nI didn&#8217;t find an answer to why not, <a href=\"https:\/\/www.kirupa.com\/forum\/showthread.php?t=239290&amp;highlight=scale9grid\" target=\"_blank\"><span style=\"color: #EF6596;\">this<\/span><\/a> post on Kirupa still has no reply, and I was using ActionScript 2.0<\/p>\n<p>Well, I used a work-around way to bypass this issue, it&#8217;s simple, just leaving the mask with sharp corners with no scale9grid applied, and draw extra border that has the same background color to hide the image corners visually!<br \/>\nthis won&#8217;t work nice unless we have only solid background color<\/p>\n<figure id=\"attachment_51\" class=\"thumbnail wp-caption aligncenter\" style=\"width: 310px\"><a href=\"https:\/\/ixdc.net\/blog\/wp-content\/uploads\/2008\/09\/s9g_01.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-51\" title=\"hiding image corners\" src=\"https:\/\/ixdc.net\/blog\/wp-content\/uploads\/2008\/09\/s9g_01.jpg\" alt=\"hiding image corners\" width=\"300\" height=\"150\" \/><\/a><figcaption class=\"caption wp-caption-text\">hiding image corners<\/figcaption><\/figure>\n<p>I was hoping that adobe fixes this issue in AcrionScript 3.0, but unfortunately they didn&#8217;t ..<\/p>\n<p>Few days ago I found <a href=\"https:\/\/blog.ickydime.com\/2008\/06\/scale9grid-class-for-masking-in-as3.html\" target=\"_blank\"><span style=\"color: #EF6596;\">this<\/span><\/a> post at Mark Grossnickle&#8217;s blog, his custom Scale9Mask works fine with masked objects, but it has to be applied individually, and there&#8217;s a scaling factor issue, <a href=\"https:\/\/ixdc.net\/blog\/wp-content\/uploads\/2008\/09\/s9g\/\" target=\"_blank\"><span style=\"color: #EF6596;\">here<\/span><\/a> is a demonstration example with source code <em>available via flash context menu<\/em><\/p>\n<p>Many thanks to Mark Grossnickle ..<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ActionScript DisplayObject has a property called scale9grid used to scale objects according to nine regions based rectangle, detailed information could be found here One day I was trying to use it for scaling effect applied to a MovieClip with curved corners and dynamic loaded image within, the problem was that the mask didn&#8217;t scale properly [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,8],"tags":[3,36,9],"class_list":["post-49","post","type-post","status-publish","format-standard","hentry","category-1","category-sep","tag-actionscript","tag-as2","tag-scale9grid"],"_links":{"self":[{"href":"https:\/\/ixdc.net\/blog\/wp-json\/wp\/v2\/posts\/49","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ixdc.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ixdc.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ixdc.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ixdc.net\/blog\/wp-json\/wp\/v2\/comments?post=49"}],"version-history":[{"count":1,"href":"https:\/\/ixdc.net\/blog\/wp-json\/wp\/v2\/posts\/49\/revisions"}],"predecessor-version":[{"id":1255,"href":"https:\/\/ixdc.net\/blog\/wp-json\/wp\/v2\/posts\/49\/revisions\/1255"}],"wp:attachment":[{"href":"https:\/\/ixdc.net\/blog\/wp-json\/wp\/v2\/media?parent=49"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ixdc.net\/blog\/wp-json\/wp\/v2\/categories?post=49"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ixdc.net\/blog\/wp-json\/wp\/v2\/tags?post=49"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}