4 Replies Latest reply on Jan 26, 2007 10:37 AM by victoratdeadline

    Application Background Problem

    victoratdeadline
      Hey all, I have this code in my application mxml:

      <mx:Style>
      /* CSS file */
      Application {
      background-image: "bin/bin/REDbackgroud.jpg";
      background-size: "100%";

      }
      </mx:Style>

      I switch to design mode and I see it fine but when I run the application I don't see any background at all. If I set the background to a gradient I see that but not the image. I am new to Flex and cannot figure it out. Can anyone help?

      Thanks
        • 1. Re: Application Background Problem
          victoratdeadline Level 1
          By the way, even if I put an image control on the page and give it the source of the same background image it shows up in design mode but shows as a broken image when I run the appliaction. What am I missing??
          • 2. Re: Application Background Problem
            victoratdeadline Level 1
            Figured it out, I had to put ../bin/image.jpg instead of bin/image.jpg. Not sure why but I think it has to do with my using a modal popup login box located in the dialog directory. Thanks
            • 3. Re: Application Background Problem
              JabbyPandaUA Level 3
              Hi,

              You had got your CSS file very wrong. Consult the Livedocs for using CSS with Flex 2.
              You should write those few CSS lines in a following way:

              backgroundImage: Embed(source="background.jpg");
              backgroundSize: "100%";
              • 4. Re: Application Background Problem
                victoratdeadline Level 1
                Jabby, I tried that I and I get these errors:

                Severity Description Resource In Folder Location Creation Time Id
                2 Error parsing stylesheet: C:\flex2btb\exercise files\exercise files\flex2btb\exercises\red\red.mxml red.mxml red line 5 January 26, 2007 10:35:07 AM 252

                //
                Severity Description Resource In Folder Location Creation Time Id
                2 ) expected. red.mxml red line 7 January 26, 2007 10:35:07 AM 250
                //
                Severity Description Resource In Folder Location Creation Time Id
                2 Identifier expected. red.mxml red line 8 January 26, 2007 10:35:07 AM 251
                //

                Here is my inline code:

                <mx:Style>
                /* CSS file */
                backgroundImage: Embed(source="bin/REDbackgroud.jpg");
                backgroundSize: "100%";
                </mx:Style>

                am I missing something?