Hi Mike, thanks for the response.  I do have a solution now, based on Dirk's example (http://www.richinternet.de/blog/index.cfm?mode=entry&entry=ADD4FDD1-9B48-BFBC-2A70F3C57EBC6892), but I would be interested in knowing what I was doing wrong.  I was doing something I saw in the framework for Application, and subclassing ProgrammaticSkin and using it in CSS as a background-image.  The skin would have to have the measuredWidth/measuredHeight, as previously mentioned, and here's the a simplified version of the updateDisplayList() method:
 
  override protected function updateDisplayList(w:Number, h:Number):void
  {
    super.updateDisplayList(w, h);
    // FIXME: override Application to add styles for all values below, then getStyle() for each
    // one and set in CSS
    var g:Graphics = graphics;
    g.clear();
    // set width and height to dimensions we want for this gradient
    w = 916;
    h = 16;
    var fillColors:Array = [0xF7F7F7, 0xD5D5D5];
    var fillAlphas:Array = [1, 1];        
    drawRoundRect(x, y, w, h, null, fillColors, fillAlphas, verticalGradientMatrix(x, y, w, h));
  }
 
And this works fine, but again only if the measuredWidth/measuredHeight is set.  So after seeing Dirk's code, I tried changing one skin over to extend HaloBorder, not set the measuredWidth/measuredHeight, and then use the skin in CSS as a border-skin.  This works, I'm happy to say.  It does feel a little strange to me, that I'm using something called "border-skin" but I'm doing things in the middle of a canvas.  Is this part normal or should I be using a background-image?
 
This turned into a longer message than I thought!  I'm starting to get into this whole building-a-Flex-app thing.  :)  -Brian


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Schmalle
Sent: Thursday, November 02, 2006 5:07 PM
To: [email protected]
Subject: Re: [flexcoders] specifying measuredWidth/measuredHeight in a skin

Hi Brian,

This dosn't make sense...

What are you subclassing for the skin class?

I use ProgrammaticSkin and RectangularBorder all the time and have never specified measuredWidth or measuredHeight in a skin. I get none of the things you are talking about.

Are you using an image or drawing API in the skin?

If it is a borderSkin style are you subclassing RectangularBorder? For the borderMetrics. Can you give an example, I am sure I could nail this one.

Peace, Mike


On 11/2/06, Brian Deitte <[EMAIL PROTECTED]com> wrote:

Ah, my first flexcoders post as a Flex developer. I feel like I should
be getting my cloak and learning a secret handshake right now.

Is there a way to not specify the measuredWidth and measuredHeight in a
skin? I don't like having to hardcode a width and height there, as I
currently have to do.

For more details, this is an application that is using absolute
positioning, and the skins are on Canvases. If I don't specify the
measured width and height in the skin, then the drawRoundRect() doesn't
draw from the correct position, and the passed-in width and height from
updateDisplayList() doesn't seem to help with this fact. Am I missing
something here?

Thanks for any pointers, Brian




--
What goes up, does come down.

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to