You should be able to create an OpenFL Shape
, call graphics.beginBitmapFill()
to draw BitmapData
, and then set the scale9Grid
property.
var shape = new Shape();
shape.graphics.beginBitmapFill(bitmapData);
shape.graphics.drawRect(0.0, 0.0, bitmapData.width, bitmapData.height);
shape.graphics.endBitmapFill();
shape.scale9Grid = new Rectangle(/* your grid values here */);
var button = new Button();
button.backgroundSkin = shape;