Hi Tracy. I hope you are ok.
I do the follow:
var d:PanelGradient=new
PanelGradient(0,0,stg.width/2,stg.height/2,30,30,stg.width/2*1.5,stg.width/2
*1.5);
d.setStyle("right",10);
d.setStyle("bottom",10);
addChild(d);
In the above code, setting the "right" and "bottom", I expect, in case of
resizing the browser, the PanelGrandient must be kept anchored in the right
bottom corner.
What I do wrong?
p.s. The PanelGradient extends the UIComponent and in real is a container of
a Shape with a matrix.
dennis
...we are what we are doing... P Think! before you print.
From: [email protected] [mailto:[email protected]] On
Behalf Of Tracy Spratt
Sent: Saturday, November 28, 2009 12:24 AM
To: [email protected]
Subject: RE: [SPAM] RE: [flexcoders] Re: constraintColumns/constraintRows on
extended Sprite object REFdn6025643069
The constraints are styles, not properties. So to use constraints in AS,
you need to define them in a style sheet, and/or use setStyle().
Tracy Spratt,
Lariat Services, development services available
_____
From: [email protected] [mailto:[email protected]] On
Behalf Of dennis
Sent: Thursday, November 26, 2009 9:48 AM
To: [email protected]
Subject: [SPAM] RE: [flexcoders] Re: constraintColumns/constraintRows on
extended Sprite object REFdn6025643069
Thank you for your reply.
I work only with AS, I mean with no MXML.
I tried to use the Canvas container but using the mx.containers.Canvas,
there is no right property (even top, bottom, left).
What do I miss?
dennis
From: [email protected] [mailto:[email protected]] On
Behalf Of jamesfin
Sent: Wednesday, November 18, 2009 7:01 PM
To: [email protected]
Subject: [flexcoders] Re: constraintColumns/constraintRows on extended
Sprite object REFdn6025643069
You can always do this where the right / top is constraining the item.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
creationComplete="init()">
<mx:Script>
<![CDATA[
import mx.core.UIComponent;
private function init():void{
var spTest:Sprite = new Sprite();
spTest.graphics.beginFill(0xFF0000);
spTest.graphics.drawRect(0, 0, 100, 100);
spTest.graphics.endFill();
logo.rawChildren.addChild(spTest);
}
]]>
</mx:Script>
<mx:Canvas width="100" height="100" right="20" top="20" id="logo"/>
</mx:Application>
--- In [email protected] <mailto:flexcoders%40yahoogroups.com> ,
"dennis" <den...@...> wrote:
>
> Hello people..
>
>
>
> I have an extended Sprite object and I put in on the Stage (via addChild).
>
> How may I "anchor" it on runtime on the Stage?
>
> How may I constraint it in Columns and Rows?
>
>
>
> Suppose that I want a Sprite(Panel) object, to be always 20 pixels from
> right edge of the Stage, even if the Stage resized.
>
>
>
> Thank in advance.
>
> Dennis
>
__________ NOD32 4618 (20091118) Information __________
This message was checked by NOD32 antivirus system.
http://www.eset.com
__________ NOD32 4643 (20091127) Information __________
This message was checked by NOD32 antivirus system.
http://www.eset.com