Does any body can tell me what´s wrong with this code?
The problem is that the scale9grid is not doing his job.
The bt.swf embed has size of 100x22.
But the trace at the end ignores it´s size. Why?
Where scale9grid should be applied to work? I try many sprites but none work.

package
{
        import flash.display.Sprite;
        import flash.display.StageScaleMode;
        import flash.geom.Rectangle;
        import mx.core.MovieClipAsset;
        import flash.display.MovieClip;

        public class BtFlash extends Sprite
        {
                [Embed(source="bt.swf")]
                private var btClass:Class;

                public function BtFlash()
                {
                        var bt:MovieClipAsset = new btClass();
                        addChild(bt);
                        var mc:Sprite = new Sprite();
                        mc.graphics.beginFill(0);
                        var rect:Rectangle = new Rectangle(6, 2, 70, 18);
                        mc.graphics.drawRect(rect.x - 1, rect.y - 1, rect.width 
+ 2,
rect.height + 2);
                        mc.graphics.endFill();
                        bt.addChild(mc);
                        bt.scale9Grid = rect;
                        trace(bt.width);
                        trace(width);
                }
        }
}

On 7/20/06, eric dolecki <[EMAIL PROTECTED]> wrote:
Marcos,

If you made the rectangle the same size as your "sprite" - there would
be no scale9 to speak of. It has to be smaller than the mc. You know
how it works from implementing it in the IDE, so you know that there
must be "outside" area that is left untouched, the interior does the
scaling.

- e.d.


On 7/20/06, Marcos Neves <[EMAIL PROTECTED]> wrote:
> No so clearly Julien,
> if(I create a rectangle with exact the same size of my sprite, it
> throw me that error. I bust make it at least 1 pixel small. It´s not
> on the docs :\
>
> On 7/20/06, Julien Vignali <[EMAIL PROTECTED]> wrote:
> > Check the Flash docs... It's explained ;-)
> >
> > mcRoundedRect.scale9Grid = new Rectangle(x1, y1, x2, y2);
> >
> >
> > Marcos Neves a écrit :
> > > How can I use programaticlly scale9grid to don´t deform a roundRect when
> > > scaled?
> > > I´know how it works at design time on flash.
> > > _______________________________________________
> > > [email protected]
> > > To change your subscription options or search the archive:
> > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> > >
> > > Brought to you by Fig Leaf Software
> > > Premier Authorized Adobe Consulting and Training
> > > http://www.figleaf.com
> > > http://training.figleaf.com
> > >
> >
> > _______________________________________________
> > [email protected]
> > To change your subscription options or search the archive:
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> > Brought to you by Fig Leaf Software
> > Premier Authorized Adobe Consulting and Training
> > http://www.figleaf.com
> > http://training.figleaf.com
> >
> _______________________________________________
> [email protected]
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to