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: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of dennis
Sent: Thursday, November 26, 2009 9:48 AM
To: flexcoders@yahoogroups.com
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: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of jamesfin
Sent: Wednesday, November 18, 2009 7:01 PM
To: flexcoders@yahoogroups.com
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



Reply via email to