--- In flexcoders@yahoogroups.com, Steffen Beyer <sbe...@...> wrote:
>
> Hi,
> 
> I'm trying to implement a custom border (based on Border) with a bitmap at 
> its bottom. Only the middle part of the bitmap must be stretched (kinda 
> Scale3).
> 
> As Border is based on a FlexShape, I can't add an Image as child -- and I 
> can't get the solution in RectangularBorder.initBackgroundImage to work, 
> either (i.e. add the child to the parent).
> 
> The current state is as follows:
> 
> protected function drawBorder(w:Number, h:Number):void
> {
>     var g:Graphics = graphics;
>                       
>     var border:Bitmap = new borderImage();
>     // setup scale9 here
>     border.width = w;
>                       
>     g.beginBitmapFill(border.bitmapData);
>     g.drawRect(0, h - 19, w, 19);
>     g.endFill();
> }
> 
> ...but doesn't work, as the bitmapData is not affected by setting a 
> scaling value for the Bitmap, I assume.

Set the scale9 grid on the graphic asset so it does what it was (i.e. set the 
top or bottom grid piece to be all the way at the top or bottom).

HTH;

Amy

Reply via email to