Constraints should work in a application parent container. Are you certain
that the application is resizing correctly?  Set up a onResize listener for
debugging purposes and make sure it is getting fired on browser resize.

 

If it is, and constraints are still not woking, then you can use that
listener to reposition you component.

 

Here is an example that positions a popup component on application resize,
it should help if you need to go the manual route.

 

Tracy Spratt,

Lariat Services, development services available

  _____  

From: [email protected] [mailto:[email protected]] On
Behalf Of dennis
Sent: Sunday, December 27, 2009 2:57 PM
To: [email protected]
Subject: [SPAM] RE: [SPAM] RE: [SPAM] RE: [flexcoders] Re:
constraintColumns/constraintRows on extended Sprite object REFdn6025643069

 

  

Hi

 

The layout it is absolute. the
Application(Application.application).layout.toString() returns "absolute".

I think the better way is to anchor my component manually :-(

Share your thoughts.

 

dennis

...we are what we are doing...  P Think! before you print. 

 

From: [email protected] [mailto:[email protected]] On
Behalf Of Tracy Spratt
Sent: Wednesday, December 23, 2009 5:49 PM
To: [email protected]
Subject: RE: [SPAM] RE: [SPAM] RE: [flexcoders] Re:
constraintColumns/constraintRows on extended Sprite object REFdn6025643069

 

  

You are clear that constraint based layout requires a Canvas or application
or panel with absolute layout?

 

Either extend one of those for your component, or size and position your
child component manually.

 

Tracy Spratt,

Lariat Services, development services available

  _____  

From: [email protected] [mailto:[email protected]] On
Behalf Of dennis
Sent: Monday, December 21, 2009 2:10 PM
To: [email protected]
Subject: [SPAM] RE: [SPAM] RE: [flexcoders] Re:
constraintColumns/constraintRows on extended Sprite object REFdn6025643069

 

  

Hello to all

Can anybody else help on this topic???

Any other suggestion how to anchor an UIComponent object?

 

dennis

 

From: dennis [mailto:[email protected]] 
Sent: Saturday, December 19, 2009 12:12 AM
To: '[email protected]'
Subject: RE: [SPAM] RE: [flexcoders] Re: constraintColumns/constraintRows on
extended Sprite object REFdn6025643069

 

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. <http://www.adobe.com/2006/mxml>
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 flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.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. <http://www.eset.com> com



__________ NOD32 4643 (20091127) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset. <http://www.eset.com> com



__________ NOD32 4712 (20091223) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset. <http://www.eset.com> com



Reply via email to