Symmetri Developer Blog

May 14, 2009

Repeating image background in Flex

Flash/Flex - By Shourov Bhattacharya

Repeating an image in the background of a visual component in Flex turns out to be non-standard and not well documented. Given Flex 3 excellent support for CSS, you would probably assume that using background-image and background-repeat would do the trick. However, it turns out that background-repeat is not supported. The way to do it is to use the background-size style and set it to 100%:

.navPrimary
{
    background-image: Embed(../images/nav-background.png);
    background-size:100%;
}

1 Comment »

  1. Actually, I got this wrong - this doesn’t repeat the image but stretches it. Often this is the same thing though, when the direction being stretched/repeated is completely constant - as, for example, in most background images used for navigation bars.

    Comment by Shourov Bhattacharya — May 18, 2009 @ 10:01 am

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.

Get free blog up and running in minutes with Blogsome
Theme designed by Janis Joseph