Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8345001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:32:52+00:00 2026-06-09T06:32:52+00:00

Is it possible within Flex 4 to change the background color of an <s:Application>

  • 0

Is it possible within Flex 4 to change the background color of an <s:Application> at runtime? I’ve seen examples of how to do this with the MX version of the Application component, but not the spark version.

I cannot bind the backgroundColor property to a variable and modify that. However, I am thinking that I should use the styleManager property of the component to perform this change.

Could anyone explain how to do this?

Thank you for your time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T06:32:55+00:00Added an answer on June 9, 2026 at 6:32 am

    I recommend you go through this:

    http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7fee.html

    The video tutorial steps through using CSS and using skins in Flex 4 which are the primary means of changing visual components.

    Application has a backgroundColor style still:
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/components/Application.html

    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                   xmlns:s="library://ns.adobe.com/flex/spark" 
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
                   creationComplete="application1_creationCompleteHandler(event)">
        <s:layout>
            <s:HorizontalLayout/>
        </s:layout>
        <fx:Script>
            <![CDATA[
                import mx.events.FlexEvent;
    
                protected function application1_creationCompleteHandler(event:FlexEvent):void
                {
                    setStyle('backgroundColor',0xCCCCCC);
                }
    
            ]]>
        </fx:Script>
        <s:Button click="setStyle('backgroundColor','0xff0000');" label="turn red"/>
        <s:Button click="setStyle('backgroundColor','0x0000ff');" label="turn blue"/>
        <s:Button click="setStyle('backgroundColor','0x00ff00');" label="turn green"/>
    </s:Application>
    

    A Better way to go IMO

    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                   xmlns:s="library://ns.adobe.com/flex/spark" 
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
        <s:layout>
            <s:HorizontalLayout/>
        </s:layout>
        <fx:Style>
            @namespace s "library://ns.adobe.com/flex/spark";
            @namespace mx "library://ns.adobe.com/flex/mx";
            s|Application{
                backgroundColor:#CCCCCC;
            }
        </fx:Style>
        <s:Button click="setStyle('backgroundColor','0xff0000');" label="turn red"/>
        <s:Button click="setStyle('backgroundColor','0x0000ff');" label="turn blue"/>
        <s:Button click="setStyle('backgroundColor','0x00ff00');" label="turn green"/>
    </s:Application>
    

    Better still pull the CSS out into it’s own file and just reference it with a

    <fx:Style source="myStyle.css"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It's possible within a Flex application, to declare elements, for example a HTTPService elements,
Possible Duplicate: How to change appearance of URL from within a PHP script I
I am converting an application from Flex to Javascript. My workflow within Eclipse for
Is it possible to get the x,y coordinates of a Flex app within an
I would like to double sort my user list. Is this possible within one
Is it possible within a PHP script to start a trace log and activate
Is intercontainer communication possible within Apache tomcat? For example: Say you have 2 rest
Is it possible to select within a select (chaining) with my jQuery? I basically
I am trying to generate a list of all possible number combinations within a
Possible Duplicate: Limiting the dates within a C# win form DateTimePicker in C#, is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.