I'm trying to use scale9Grid in haXe on an image that I imported with swfmill.
border = flash.Lib.attach("BorderPic");
border.scale9Grid = new Rectangle(15, 15, 1, 1);
The second line generates the following runtime error:
ArgumentError: Error #2004: One of the parameters is invalid.
at flash.display::DisplayObject/set scale9Grid()
I think you're supposed to get this error if the rectangle is outside the bounds of the image. However, the image I'm using is 31x31 so that shouldn't be the case. Also, when I do the same thing on a MovieClip that was created by drawing with Graphics, it works fine.
I'm using haXe 2.00 and swfmill 0.2.12.6 (unofficial build), both on Windows.
What is causing the error and, if possible, how can I get scale9Grid to work with my imported image?