Changing themes of application in Flex 3

Hi All ,below is my  mxml file , in which i am trying to change theme of my flex application by selecting the themes in combo box, but it is not working fine.Is there any bug in code ??? How to change the theme of flex application in Flex 3.. Plzz help...
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
           import mx.controls.Alert;
            import mx.collections.ArrayCollection;
            import mx.styles.StyleManager;
            private var cssLoader:URLLoader;
          private var cssRequest:URLRequest;
          [Bindable]
            public var cards:ArrayCollection = new ArrayCollection(
                [ {label:"Theme 0", data:0},
                  {label:"Theme 1", data:1},
                  {label:"Theme 2", data:2},
                  {label:"Theme 3", data:3} ]);
               private function closeHandler(event:Event):void {
               if(event.target.selectedItem.data == 1){
                cssLoader = new URLLoader();
                cssRequest = new URLRequest("Alert.css");
                cssLoader.addEventListener(Event.COMPLETE, cssLoaderComplete);
                cssLoader.load(cssRequest);
            if(event.target.selectedItem.data == 2){
              cssLoader = new URLLoader();
                cssRequest = new URLRequest("Alert1.css");
                cssLoader.addEventListener(Event.COMPLETE, cssLoaderComplete);
                cssLoader.load(cssRequest);
            if(event.target.selectedItem.data == 3){
              cssLoader = new URLLoader(); 
                cssRequest = new URLRequest("Alert2.css");
                cssLoader.addEventListener(Event.COMPLETE, cssLoaderComplete);
                cssLoader.load(cssRequest);
             private function cssLoaderComplete(event:Event):void
                 var sheet:StyleSheet = new StyleSheet();
                 sheet.parseCSS(cssLoader.data);
                 Application.application.styleSheet = sheet;
]]>
</mx:Script>
<mx:Button label="Click Me"  x="337" y="148"/>
<mx:ComboBox dataProvider="{cards}" id="themeCombo" width="100"  change="closeHandler(event);" x="308" y="205"/>
</mx:Application>

Hi Bhasker,
I work for big bank sector corp - Citigroup.,i am using themes to load themes dynamically using style manager class.i wrote a application which have 3 themes as a combo box items. when theme selected the look and feel of the same application's UI screen has to change. for the loading i used below mxml application. please advise me as need to submit this task today to implement all our project.it will be very gr8 if u can help me.
<?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">
 <fx:Script><![CDATA[
import mx.controls.Alert;
import mx.styles.StyleManager;
import mx.events.StyleEvent;
[Bindable] private var themes:Array = [ "AeonGraphical","Spark","Halo" ];
private function initApp():void {
//Initialize the ComboBox to the first theme in the themes Array.
themesCmbBox.selectedIndex = themes.indexOf(0);
private function thmsCmbChangeHandler(themeName:String):void {
themeName= themesCmbBox.selectedLabel;
if (themeName!=null && themeName == "AeonGraphical") {
styleManager.loadStyleDeclarations("assets/AeonGraphical/AeonGraphical.swf");
if (themeName!=null && themeName == "Spark") {
styleManager.unloadStyleDeclarations("assets/AeonGraphical/AeonGraphical.swf");
styleManager.loadStyleDeclarations("assets/Spark/spark.swf");
if (themeName!=null && themeName == "Halo") {
styleManager.unloadStyleDeclarations("assets/Spark/spark.swf");
styleManager.loadStyleDeclarations("assets/Halo/halo.swf");
private function registrationComplete():void {
Alert.show('Thank you for registering!');
private function clickClear(event:KeyboardEvent=null):void {
if(event==null || event.keyCode == 13 ) {
person.text = "" ;
addr.text = "" ;
city.text = "";
state.text = "" ;
zip.text = "" ;
]]>
</fx:Script>
 <mx:Form id="Themes">
 <mx:FormItem>  
<mx:Label text="{'Themes Demo in Flash 4'}" fontSize="35"/>  
</mx:FormItem>  
<mx:FormItem label="Themes" >  
<mx:ComboBox id="themesCmbBox" dataProvider="{themes}" change="thmsCmbChangeHandler(themesCmbBox.selectedLabel)" />  
</mx:FormItem>  
<mx:FormItem label="Person Name">
 <mx:TextInput id="person" />
 </mx:FormItem>
 <mx:FormItem label="Street Address">
 <mx:TextInput id="addr"/>
 </mx:FormItem>
 <mx:FormItem label="City">
 <mx:TextInput id="city"/>
 </mx:FormItem>
 <mx:FormItem label="State">
 <mx:TextInput id="state" />
 </mx:FormItem>
 <mx:FormItem label="ZIP Code">
 <mx:TextInput id="zip" />
 </mx:FormItem>  
</mx:Form>
 <mx:HBox>
 <mx:Button id="sub" label="{'Submit'}" y="100" click="registrationComplete()" />
 <mx:Button id="reset" label="{'Reset'}" buttonDown="clickClear()" keyDown="clickClear(event)" />
 </mx:HBox> 
</s:Application>
and i given the compiler option: -theme=${flexlib}/themes/Halo/halo.swc,${flexlib}/themes/Spark/spark.css,${flexlib}/theme s/AeonGraphical/AeonGraphical.css
i tried with locally project assets path, and framework path nothing work out. and added these themes in the flex-config.xml file also. please advise me ASAP
Advance Thanks,
Usha
Optional Information:
Computer OS: Windows XP
Programming Language: mxml/as3
Compiler: flash 4.1.0

Similar Messages

  • Changing theme of application in Flex 3

    Hi All ,below is my  mxml file , in which i am trying to change theme of my flex application by selecting the themes in combo box, but it is not working fine.Is there any bug in code ??? How to change the theme of flex application in Flex 3.. Plzz help...
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script>
    <![CDATA[
               import mx.controls.Alert;
                import mx.collections.ArrayCollection;
                import mx.styles.StyleManager;
                private var cssLoader:URLLoader;
              private var cssRequest:URLRequest;
              [Bindable]
                public var cards:ArrayCollection = new ArrayCollection(
                    [ {label:"Theme 0", data:0},
                      {label:"Theme 1", data:1},
                      {label:"Theme 2", data:2},
                      {label:"Theme 3", data:3} ]);
                   private function closeHandler(event:Event):void {
                   if(event.target.selectedItem.data == 1){
                    cssLoader = new URLLoader();
                    cssRequest = new URLRequest("Alert.css");
                    cssLoader.addEventListener(Event.COMPLETE, cssLoaderComplete); 
                    cssLoader.load(cssRequest); 
                if(event.target.selectedItem.data == 2){
                  cssLoader = new URLLoader();
                    cssRequest = new URLRequest("Alert1.css");
                    cssLoader.addEventListener(Event.COMPLETE, cssLoaderComplete); 
                    cssLoader.load(cssRequest); 
                if(event.target.selectedItem.data == 3){
                  cssLoader = new URLLoader();  
                    cssRequest = new URLRequest("Alert2.css");
                    cssLoader.addEventListener(Event.COMPLETE, cssLoaderComplete); 
                    cssLoader.load(cssRequest);
                 private function cssLoaderComplete(event:Event):void
                     var sheet:StyleSheet = new StyleSheet();
                     sheet.parseCSS(cssLoader.data);
                     Application.application.styleSheet = sheet;
    ]]>
    </mx:Script>
    <mx:Button label="Click Me"  x="337" y="148"/>
    <mx:ComboBox dataProvider="{cards}" id="themeCombo" width="100"  change="closeHandler(event);" x="308" y="205"/>
    </mx:Application>

    Hi All ,below is my  mxml file , in which i am trying to change theme of my flex application by selecting the themes in combo box, but it is not working fine.Is there any bug in code ??? How to change the theme of flex application in Flex 3.. Plzz help...
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script>
    <![CDATA[
               import mx.controls.Alert;
                import mx.collections.ArrayCollection;
                import mx.styles.StyleManager;
                private var cssLoader:URLLoader;
              private var cssRequest:URLRequest;
              [Bindable]
                public var cards:ArrayCollection = new ArrayCollection(
                    [ {label:"Theme 0", data:0},
                      {label:"Theme 1", data:1},
                      {label:"Theme 2", data:2},
                      {label:"Theme 3", data:3} ]);
                   private function closeHandler(event:Event):void {
                   if(event.target.selectedItem.data == 1){
                    cssLoader = new URLLoader();
                    cssRequest = new URLRequest("Alert.css");
                    cssLoader.addEventListener(Event.COMPLETE, cssLoaderComplete); 
                    cssLoader.load(cssRequest); 
                if(event.target.selectedItem.data == 2){
                  cssLoader = new URLLoader();
                    cssRequest = new URLRequest("Alert1.css");
                    cssLoader.addEventListener(Event.COMPLETE, cssLoaderComplete); 
                    cssLoader.load(cssRequest); 
                if(event.target.selectedItem.data == 3){
                  cssLoader = new URLLoader();  
                    cssRequest = new URLRequest("Alert2.css");
                    cssLoader.addEventListener(Event.COMPLETE, cssLoaderComplete); 
                    cssLoader.load(cssRequest);
                 private function cssLoaderComplete(event:Event):void
                     var sheet:StyleSheet = new StyleSheet();
                     sheet.parseCSS(cssLoader.data);
                     Application.application.styleSheet = sheet;
    ]]>
    </mx:Script>
    <mx:Button label="Click Me"  x="337" y="148"/>
    <mx:ComboBox dataProvider="{cards}" id="themeCombo" width="100"  change="closeHandler(event);" x="308" y="205"/>
    </mx:Application>

  • [SOLVED] Adding layouts and changing them per application

    Hi
    I have just installed openbox not a long ago, and I was wondering,
    how can I add another keyboard layout? (Hebrew for example)
    I heard that I can do it through xorg.conf, but then, changing layouts
    will be globaly and not per application.
    How can I add another layout to my openbox and change layout with
    alt+shift per application?
    Thanks
    Last edited by DarkLikeHell (2009-04-09 21:41:46)

    Problem solved thanks to DHeart!
    I created /etc/hal/fdi/10-keymap.fdi:
    <?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
    <deviceinfo version="0.2">
    <device>
    <match key="info.capabilities" contains="input.keymap">
    <append key="info.callouts.add" type="strlist">hal-setup-keymap</append>
    </match>
    <match key="info.capabilities" contains="input.keys">
    <merge key="input.xkb.rules" type="string">base</merge>
    <!-- If we're using Linux, we use evdev by default (falling back to
    keyboard otherwise). -->
    <merge key="input.xkb.model" type="string">keyboard</merge>
    <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
    string="Linux">
    <merge key="input.xkb.model" type="string">evdev</merge>
    </match>
    <merge key="input.xkb.layout" type="string">us,il</merge>
    <merge key="input.xkb.model" type="string">pc105</merge>
    <merge key="input.xkb.Options" type="string">grp:ctrl_shift_toggle</merge>
    </match>
    </device>
    </deviceinfo>
    I installed xxkb, and added "exec xxkb &" to my openbox's autostart script.
    And it works almost perfect!
    Last edited by DarkLikeHell (2009-04-10 08:03:49)

  • Enhancement request: Change theme in Application Builder

    It would be nice to apply a different theme or skin to the App Builder environment itself. Sort of like Firefox themes or any number of apps with a changeable skin. Login to the HTML DB studio, download a new theme, upload/apply it, done.
    One gets bored with the same look-n-feel after a few days!
    Thanks

    Hello,
    Not anytime soon, but maybe in future versions.
    Carl

  • Changing theme template in my APEX applications by scripts

    Hello every body,
    I wonder if there any issue to change my APEX applications themes by script ?
    Best Regards

    Anton,
    1) When you export your application 100 from within Application Express from your old instance and you compare it to the one generated, are there any significant differences?
    2) Can you export your application 100 from within Application Express from your old instance and import it back into the same (old) instance but with a different application identifier?
    Joel

  • "Network settings have be changed by another application" stuck in loops

    I have the exact problem as others with Network System Preferences saying that the settings have been changed by another application. The message goes into a loop that can only be stopped with a Force Quit of the Preferences. I also have the Airport not connecting at start-up without choosing the Network Name from the Airport Pull down menu. I also think it may have started with the last Security upgrade and Java upgrade. I have used the airport utility to reconfig the base station. I discovered a system keychain with a password for the airport that my normal passwords would not open to show what it's password was. I have done many disk permissions and verifications. Any ideas? I would think if this is a Security update error, that Apple would be aware of it by now and post a repair. I have followed some threads on this issue but would rather wait for an Apple fix. There appears to be no way to contact Apple in customer support.

    A Fix for "Your network preferences have been changed by another application" Error
    In the Library/Preferences/SystemConfiguration/ folder delete the following:
    com.apple.airport.preferences.plist
    NetworkInterfaces.plist
    preferences.plist
    com.apple.nat.plist
    You will have to re-configure all your network settings since deleting these files will cause them to be returned to defaults.

  • All my pdf files were converted to adobe. How do I change them back?

    All my pdf files were converted to adobe. How do I change them back?

    Hi Jerome Winn,
    Please follow the steps mentioned in the link below and check the workflow.
    http://helpx.adobe.com/acrobat/kb/application-file-icons-change-acrobat.html
    Regards,
    Anand

  • Open With... How to Change List of Applications?

    I installed Photoshop CS2 recently and now a whole slew of applications show up when I click on a jpg file and select "Open With..." I know how to change the default application for the files, but how do I remove applications from this list? I don't need to ever choose between 40 applications to open jpeg files - just a few. How can I pare down this list?
    Thanks,
    tommy

    Then why don't you remove them yourself? Go to this page and download PropertyListEditor.dmg. It normally is incuded with the free XCode package from Apple.
    Install the app in your Utilities folder and then you can edit plist files whenever you want.
    Open com.apple.launchservices.plist and unfold the object tree. Now you can browse and delete objects. It is recommended you backup the file before messing with it.
    You can also "Dump" the entire file, it might be faster to see what all is in it.

  • I want to install onyx but my security preferences won't let me download it. Is it safe to change them and download from an unidentified developer? Will they be able to access my information?

    I want to install onyx but my security preferences won't let me download it. Is it safe to change them and download from an unidentified developer? Will they be able to access my information?

    1. If you just want to run one application, control-click it and choose Open instead of changing the setting. This only needs to be done once per application.
    2. Ensure that you trust any software you choose to open in this way.
    (108081)

  • SOLUTION: Building the Flex 2 FlexStore application in Flex 3

    I gave step by step instructions on building the Flex 2 FlexStore application in Flex 3 as a post in the Adobe Flex 3 Cookbook:
    http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=2&postI d=15606&loc=en_US
    If you don't want to go there, here are the instructions:
    1) Download the Adobe FlexStore archive flexstore.zip file.
        - go to http://examples.adobe.com/flex2/inproduct/sdk/flexstore/flexstore.html
        - right-click the application and select View Source
        - click the "Download source (ZIP, 1769K)" link in bottom of the left-side-bar
    2) Create a directory "flexstore" somewhere on your harddrive
    3) Extract the contents of the flexstore.zip file to the directory flexstore you
       just created. The directory flexstore should now have these top-level contents:
           assets           (directory)
           data             (directory)
           productsView     (directory)
           samples          (directory)
           AC_OETags.js     (file)
           beige.css        (file)
           blue.css         (file)
           build.bat        (file)
           build.sh         (file)
           flexstore.html   (file)
           flexstore.mxml   (file)
           HomeView.mxml    (file)
           main.css         (file)
           ProductsView.mxml    (file)
           README.htmlSupportView.mxml   (file)
    4) Launch Flex Builder 3.
    5) Select File - Switch Workspace and change the workspace to the directory
       containing the directory "flexstore" you created.
    6) After Flex Builder re-launches, create a new Flex Project named "flexstore":
        - ensure the "Web application" radio button is selected for "Application type"
        - click the "Next" button, not the "Finish" button
        - click "Next" again in the "Configure Output" screen
        - ensure the "Main source folder" TextInput has "src" in it
        - ensure the "Main application file" TextInput has "flexstore.mxml" in it
        - click the Finish button
    7) Drag all the unzipped files now visible in your Flex Builder "flexstore" project
       folder to the "src" folder Flex Builder created for you, and click "Yes" when
       asked if you want to overwrite the flexstore.mxml file Flex Builder created for you.
    8) In Flex Builder, drag the following folders into the "src" folder:
        - assets
        - data
        - productsView
        - samples
    9) Right click file build.bat and select Open With - Text Editor.
        - Remove the following line from the file:
             ..\..\bin\mxmlc.exe %OPTS% flexstore.mxml
        - Edit the following lines, replacing "..\..\bin\mxmlc.exe" with the hardcoded
          path to the mxmlc compiler for the Flex 3 SDK, which on my computer is
          "C:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0\bin\mxmlc.exe". Make sure
          it is enclosed in double-quotes. This will be to build.sh for Mac users.
             BEFORE
             ..\..\bin\mxmlc.exe %OPTS% beige.css
             ..\..\bin\mxmlc.exe %OPTS% blue.css
             AFTER
             "C:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0\bin\mxmlc.exe" %OPTS% beige.css
             "C:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0\bin\mxmlc.exe" %OPTS% blue.css
    10) Open a DOS window (Terminal in Mac) and change the current directory to the "src"
        directory on the local harddisk, which for me is:
        C:\aaaFlexApps\flexstore\src
    11) Execute build.bat (build.sh on Mac).
    12) Ensure beige.swf and blue.swf are created in the project "src" directory.
    13) Select Project - Clean to rebuild the project.
    14) Ensure beige.swf and blue.swf and all the other files from the src
        directory were copied to the bin-debug folder.
    15) You should now be able to launch the application.

    Here the fxp project that i export with flex builder 4 -> source-code
    Thank's Greg

  • Support document for Migration of application fro flex 2 o flex 3

    Support document for Migration of application fro flex 2 to
    flex 3

    I'm sorry to hear that you are having problems. A few APIs
    did change from B3 to final, but you should be getting compile
    errors for those. I can assure you that all of the areas you
    mentioned were tested and are working for many folks so if you can
    supply examples of what isnt working we can try to get you back up
    and running.

  • How can change language of application dynamic?

    In the dialog I have combo box in which I can select desire language for application. When I select value I save this value in the config file. But language change ONLY when I exit and again enter to the application. How can change language of application dynamic (without exit from application) ?

    alexpass wrote:
    In the dialog I have combo box in which I can select desire language for application. When I select value I save this value in the config file. But language change ONLY when I exit and again enter to the application. How can change language of application dynamic (without exit from application) ?I guess your application sets the locale at "startup", based on the contents of the config file, using a call to java.util .Locale.setDefault(Locale). Did you try to call this method in response to the selection in the combobox?
    This won't refresh all widgets already created however. You probably have to re-create them all.
    There may be case-by-case way to refresh them, for example Locale-dependent layout may be taken into account dynamically. Try and tell us.

  • Network settings changed by another application.

    I select the Network option under system preferences.
    I get a dialog box that says, "Your network settings have been changed by another application."
    What does that mean?
    This happens on my eMac and not my iMac.

    A Fix for "Your network preferences have been changed by another application" Error
    In the Library/Preferences/SystemConfiguration/ folder delete the following:
    com.apple.airport.preferences.plist
    NetworkInterfaces.plist
    preferences.plist
    com.apple.nat.plist
    You will have to re-configure all your network settings since deleting these files will cause them to be returned to defaults.

  • Change "Services and applications" names in failover cluster manager

    Hi. Id like to change "Services and applications" names in failover cluster manager for Windows Server 2008 R2.
    I right click on one and press rename, but when i change the name and press enter i get the message "To rename this service or application please rename the Client Access Point via its property page"
    It's important that we don't change the network name for the service

    Hi,
    Checkout this blog post
    PowerShell for Failover Clustering: Let’s Rename a Few Things
    But keep in mind if you rename the resources and you are using them in a script or backup you need to check this also with the new name.
    Greetings, Robert Smit Follow me @clustermvp http://robertsmit.wordpress.com/ “Please click "Vote As Helpful" if it is helpful for you and Proposed As Answer” Please remember to click “Mark as Answer” on the post that helps you

  • Calendar events keep changing back after I change them

    On my iMac 3.2 GHz Intel Core i5,  8 GB 1600 MHz, Yosemite loaded, calendar 8.0 events will not change. I can add events but not change them. I've tried refresh. I've followed all the troubleshooting re: to iCloud.

    Apple's Mail application can use either IMAP or POP. In fact Gmail can be set either way.

Maybe you are looking for

  • Is there a way to change the default sound for alarms?

    That is, when I set a new event, I have it set to have the alarm activate one day before the actual event (thanks to MadisonP for answering that). I'd like to change the default alarm from Basso to something a little more pleasant. Is it possible to

  • Reading a String from the Console.

    Hello, I am new to Java... I have to write a program which will read a long value from the console. Can somebody help me in this? or can i read it as a string and then convert to Long ? I prefer the second one as I am planning to convert this code to

  • Desktop creative cloud app - keeps asking for sign in

    Hi, I have recently signed up for the Photoshop creative cloud package. I can use my Photoshop and lightroom fine but when I try to use the creative cloud icon on my desktop, it asks me to sign in which I do. It then says you have been signed out ple

  • Change page attribute with JavaScript

    Hi, hope someone can help. Is it possible to change a BSP page attribute with JavaScript?? I have a JavaScript array with some serialnumbers. After push a save button, i want to save the array data into a page attribute. Some ideas? Regards Anton

  • Radio not working on any OS?

    I can confirm that radio is not working any of my Macs.