RE: [flexcoders] Dynamically Changing an entire CSS
Title: Message There is no CSS parser in the Flash Player or in the Flex framework... only in the MXML compiler. So you can't load a CSS file at runtime unless you want to parse it yourself. But if you save your user profiles -- including their customized styles -- as XML files on the server, you could download them, parse them, and set various styles, including global styles that affect the entire application, using a fairly small amount of ActionScript. - Gordon -Original Message-From: Matthew Shirey [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 06, 2005 4:39 PMTo: flexcoders@yahoogroups.comSubject: Re: [flexcoders] Dynamically Changing an entire CSS Right, but what I am trying to do requires the style to be selectable on a per user basis,from a profile setting. I have a workaround I am currently attempting. It's a little hackish, but doesn't require a ton of actionscript. If its successful then I'll share to this list. -- Matthew On Apr 6, 2005 11:39 AM, JesterXL [EMAIL PROTECTED] wrote: Nope, you were right the first time; Flash does "compile" the CSS into the SWF; basically hardcodes the CSS value settings. The reason I said upload a new CSS to the server is that the Flex server, when a new request comes in for the MXML file, should detect the CSS file change, and generate a new SWF for the end user that will have the new CSS styles in it. - Original Message - From: Matthew Shirey To: flexcoders@yahoogroups.com Sent: Wednesday, April 06, 2005 2:34 PM Subject: Re: [flexcoders] Dynamically Changing an entire CSS Okay wait, let me get this right... Flex does not compile the css directly into the resulting swf? It reads the css at runtime? If that is true then you could write a jsp file that output the CSS. That css could change based on cookie or session type data. Does that sound like an option that might work? -- Matthew On Apr 6, 2005 10:25 AM, JesterXL [EMAIL PROTECTED] wrote: You cannot change CSS at runtime except via the setting of styles, as you have indicated. However, if restarting the application is acceptable, simply replace the CSS file on the server, and refresh the browser. - Original Message - From: Matthew Shirey To: flexcoders@yahoogroups.com Sent: Wednesday, April 06, 2005 1:13 PM Subject: [flexcoders] Dynamically Changing an entire CSS After searching the mailing list archives I cannot seem to find a good answer for this question so I thought I'd re-ask it and see if it could get some additional feedback. We have multiple VERY extensive CSS files. We'd like to be able to dynamically switch between the CSS files at run time. So far the only solution that I have been able to come up with is to use the JSP Flex tag library to generate the main mxml application file and dynamically set the CSS file there. I only need to set this once, during the application initialization. If the CSS preference is changed, it is acceptable to restart the application. I saw some rather hackish ways of programmatically going through and resetting the style on individual items in the application, but this is very large application and that's just impractical. Ideally we just need to change the CSS. Is there no way to do this in MXML/ActionScript? Is this just a missing feature that we might expectfixed/added in a future version? Thank you, -- Matthew Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Re: [flexcoders] Dynamically Changing an entire CSS
This type of solution sounds a little like what I am trying to avoid, but do you have an example of what that would look like? It sounds like it might be a bit more complex than my hack even, but I'd like to be able to compare the two solutions. -- Matthew On Apr 6, 2005 11:57 PM, Gordon Smith [EMAIL PROTECTED] wrote: There is no CSS parser in the Flash Player or in the Flex framework... only in the MXML compiler. So you can't load a CSS file at runtime unless you want to parse it yourself. But if you save your user profiles -- including their customized styles -- as XML files on the server, you could download them, parse them, and set various styles, including global styles that affect the entire application, using a fairly small amount of ActionScript. - Gordon -Original Message-From: Matthew Shirey [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 06, 2005 4:39 PMTo: flexcoders@yahoogroups.comSubject: Re: [flexcoders] Dynamically Changing an entire CSS Right, but what I am trying to do requires the style to be selectable on a per user basis,from a profile setting. I have a workaround I am currently attempting. It's a little hackish, but doesn't require a ton of actionscript. If its successful then I'll share to this list. -- Matthew On Apr 6, 2005 11:39 AM, JesterXL [EMAIL PROTECTED] wrote: Nope, you were right the first time; Flash does compile the CSS into the SWF; basically hardcodes the CSS value settings. The reason I said upload a new CSS to the server is that the Flex server, when a new request comes in for the MXML file, should detect the CSS file change, and generate a new SWF for the end user that will have the new CSS styles in it. - Original Message - From: Matthew Shirey To: flexcoders@yahoogroups.com Sent: Wednesday, April 06, 2005 2:34 PM Subject: Re: [flexcoders] Dynamically Changing an entire CSS Okay wait, let me get this right... Flex does not compile the css directly into the resulting swf? It reads the css at runtime? If that is true then you could write a jsp file that output the CSS. That css could change based on cookie or session type data. Does that sound like an option that might work? -- Matthew On Apr 6, 2005 10:25 AM, JesterXL [EMAIL PROTECTED] wrote: You cannot change CSS at runtime except via the setting of styles, as you have indicated. However, if restarting the application is acceptable, simply replace the CSS file on the server, and refresh the browser. - Original Message - From: Matthew Shirey To: flexcoders@yahoogroups.com Sent: Wednesday, April 06, 2005 1:13 PM Subject: [flexcoders] Dynamically Changing an entire CSS After searching the mailing list archives I cannot seem to find a good answer for this question so I thought I'd re-ask it and see if it could get some additional feedback. We have multiple VERY extensive CSS files. We'd like to be able to dynamically switch between the CSS files at run time. So far the only solution that I have been able to come up with is to use the JSP Flex tag library to generate the main mxml application file and dynamically set the CSS file there. I only need to set this once, during the application initialization. If the CSS preference is changed, it is acceptable to restart the application. I saw some rather hackish ways of programmatically going through and resetting the style on individual items in the application, but this is very large application and that's just impractical. Ideally we just need to change the CSS. Is there no way to do this in MXML/ActionScript? Is this just a missing feature that we might expectfixed/added in a future version? Thank you, -- Matthew Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [flexcoders] Dynamically Changing an entire CSS
Title: Message Sorry, I don't have any examples. I was just offeringa theoretical solution. ; ) But you should be able to programmaticallychange a global style like this: StyleManager.styles.global.setStyle("fontSize", 14); and astyle for all instances of a particularcomponent like this: StyleManager.styles.Button.setStyle("fontSize", 14); - Gordon -Original Message-From: Matthew Shirey [mailto:[EMAIL PROTECTED] Sent: Thursday, April 07, 2005 11:02 AMTo: flexcoders@yahoogroups.comSubject: Re: [flexcoders] Dynamically Changing an entire CSS This type of solution sounds a little like what I am trying to avoid, but do you have an example of what that would look like? It sounds like it might be a bit more complex than my hack even, but I'd like to be able to compare the two solutions. -- Matthew On Apr 6, 2005 11:57 PM, Gordon Smith [EMAIL PROTECTED] wrote: There is no CSS parser in the Flash Player or in the Flex framework... only in the MXML compiler. So you can't load a CSS file at runtime unless you want to parse it yourself. But if you save your user profiles -- including their customized styles -- as XML files on the server, you could download them, parse them, and set various styles, including global styles that affect the entire application, using a fairly small amount of ActionScript. - Gordon -Original Message-From: Matthew Shirey [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 06, 2005 4:39 PMTo: flexcoders@yahoogroups.comSubject: Re: [flexcoders] Dynamically Changing an entire CSS Right, but what I am trying to do requires the style to be selectable on a per user basis,from a profile setting. I have a workaround I am currently attempting. It's a little hackish, but doesn't require a ton of actionscript. If its successful then I'll share to this list. -- Matthew On Apr 6, 2005 11:39 AM, JesterXL [EMAIL PROTECTED] wrote: Nope, you were right the first time; Flash does "compile" the CSS into the SWF; basically hardcodes the CSS value settings. The reason I said upload a new CSS to the server is that the Flex server, when a new request comes in for the MXML file, should detect the CSS file change, and generate a new SWF for the end user that will have the new CSS styles in it. - Original Message - From: Matthew Shirey To: flexcoders@yahoogroups.com Sent: Wednesday, April 06, 2005 2:34 PM Subject: Re: [flexcoders] Dynamically Changing an entire CSS Okay wait, let me get this right... Flex does not compile the css directly into the resulting swf? It reads the css at runtime? If that is true then you could write a jsp file that output the CSS. That css could change based on cookie or session type data. Does that sound like an option that might work? -- Matthew On Apr 6, 2005 10:25 AM, JesterXL [EMAIL PROTECTED] wrote: You cannot change CSS at runtime except via the setting of styles, as you have indicated. However, if restarting the application is acceptable, simply replace the CSS file on the server, and refresh the browser. - Original Message - From: Matthew Shirey To: flexcoders@yahoogroups.com Sent: Wednesday, April 06, 2005 1:13 PM Subject: [flexcoders] Dynamically Changing an entire CSS After searching the mailing list archives I cannot seem to find a good answer for this question so I thought I'd re-ask it and see if it could get some additional feedback. We have multiple VERY extensive CSS files. We'd like to be able to dynamically switch between the CSS files at run time. So far the only solution that I have been able to come up with is to use the JSP Flex tag library to generate the main mxml application file and dynamically set the CSS file there. I only need to set this once, during the application initialization. If the CSS preference is changed, it is acceptable to restart the application. I saw some rather hackish ways of programmatically going through and resetting the style on individual items in the application, but this is very large application and that's just impractical. Ideally we just need to change the CSS. Is there no way to do this in MXML/ActionScript? Is this just a missing feature that we might expectfixed/added
Re: [flexcoders] Dynamically Changing an entire CSS
Okay, I am starting to see how this could work. Is there a way to change a css class definition tho? Using your example would that be like: StyleManager.styles.myClass.setStyle(fontSize, 14); I am just guessing here. I have a long series of defined css classes that I would have to modify. If there is a way to modify these then this might indeed be easier than my own solution. -- Matthew On Apr 7, 2005 12:16 PM, Gordon Smith [EMAIL PROTECTED] wrote: Sorry, I don't have any examples. I was just offeringa theoretical solution. ; ) But you should be able to programmaticallychange a global style like this: StyleManager.styles.global.setStyle(fontSize, 14); and astyle for all instances of a particularcomponent like this: StyleManager.styles.Button.setStyle(fontSize, 14); - Gordon -Original Message-From: Matthew Shirey [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 07, 2005 11:02 AMTo: flexcoders@yahoogroups.comSubject: Re: [flexcoders] Dynamically Changing an entire CSS This type of solution sounds a little like what I am trying to avoid, but do you have an example of what that would look like? It sounds like it might be a bit more complex than my hack even, but I'd like to be able to compare the two solutions. -- Matthew On Apr 6, 2005 11:57 PM, Gordon Smith [EMAIL PROTECTED] wrote: There is no CSS parser in the Flash Player or in the Flex framework... only in the MXML compiler. So you can't load a CSS file at runtime unless you want to parse it yourself. But if you save your user profiles -- including their customized styles -- as XML files on the server, you could download them, parse them, and set various styles, including global styles that affect the entire application, using a fairly small amount of ActionScript. - Gordon -Original Message-From: Matthew Shirey [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 06, 2005 4:39 PMTo: flexcoders@yahoogroups.comSubject: Re: [flexcoders] Dynamically Changing an entire CSS Right, but what I am trying to do requires the style to be selectable on a per user basis,from a profile setting. I have a workaround I am currently attempting. It's a little hackish, but doesn't require a ton of actionscript. If its successful then I'll share to this list. -- Matthew On Apr 6, 2005 11:39 AM, JesterXL [EMAIL PROTECTED] wrote: Nope, you were right the first time; Flash does compile the CSS into the SWF; basically hardcodes the CSS value settings. The reason I said upload a new CSS to the server is that the Flex server, when a new request comes in for the MXML file, should detect the CSS file change, and generate a new SWF for the end user that will have the new CSS styles in it. - Original Message - From: Matthew Shirey To: flexcoders@yahoogroups.com Sent: Wednesday, April 06, 2005 2:34 PM Subject: Re: [flexcoders] Dynamically Changing an entire CSS Okay wait, let me get this right... Flex does not compile the css directly into the resulting swf? It reads the css at runtime? If that is true then you could write a jsp file that output the CSS. That css could change based on cookie or session type data. Does that sound like an option that might work? -- Matthew On Apr 6, 2005 10:25 AM, JesterXL [EMAIL PROTECTED] wrote: You cannot change CSS at runtime except via the setting of styles, as you have indicated. However, if restarting the application is acceptable, simply replace the CSS file on the server, and refresh the browser. - Original Message - From: Matthew Shirey To: flexcoders@yahoogroups.com Sent: Wednesday, April 06, 2005 1:13 PM Subject: [flexcoders] Dynamically Changing an entire CSS After searching the mailing list archives I cannot seem to find a good answer for this question so I thought I'd re-ask it and see if it could get some additional feedback. We have multiple VERY extensive CSS files. We'd like to be able to dynamically switch between the CSS files at run time. So far the only solution that I have been able to come up with is to use the JSP Flex tag library to generate the main mxml application file and dynamically set the CSS file there. I only need to set this once, during the application initialization. If the CSS preference is changed, it is acceptable to restart the application. I saw some rather hackish ways of programmatically going through and resetting the style on individual items in the application, but this is very large application and that's just impractical. Ideally we just need to change the CSS. Is there no way to do this in MXML/ActionScript? Is this just a missing feature that we might expectfixed/added in a future version? Thank you, -- Matthew Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Yahoo! Groups Links To visit your group on the web, go to:http
[flexcoders] Dynamically Changing an entire CSS
After searching the mailing list archives I cannot seem to find a good answer for this question so I thought I'd re-ask it and see if it could get some additional feedback. We have multiple VERY extensive CSS files. We'd like to be able to dynamically switch between the CSS files at run time. So far the only solution that I have been able to come up with is to use the JSP Flex tag library to generate the main mxml application file and dynamically set the CSS file there. I only need to set this once, during the application initialization. If the CSS preference is changed, it is acceptable to restart the application. I saw some rather hackish ways of programmatically going through and resetting the style on individual items in the application, but this is very large application and that's just impractical. Ideally we just need to change the CSS. Is there no way to do this in MXML/ActionScript? Is this just a missing feature that we might expectfixed/added in a future version? Thank you, -- Matthew Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Re: [flexcoders] Dynamically Changing an entire CSS
Okay wait, let me get this right... Flex does not compile the css directly into the resulting swf? It reads the css at runtime? If that is true then you could write a jsp file that output the CSS. That css could change based on cookie or session type data. Does that sound like an option that might work? -- Matthew On Apr 6, 2005 10:25 AM, JesterXL [EMAIL PROTECTED] wrote: You cannot change CSS at runtime except via the setting of styles, as you have indicated. However, if restarting the application is acceptable, simply replace the CSS file on the server, and refresh the browser. - Original Message - From: Matthew Shirey To: flexcoders@yahoogroups.com Sent: Wednesday, April 06, 2005 1:13 PM Subject: [flexcoders] Dynamically Changing an entire CSS After searching the mailing list archives I cannot seem to find a good answer for this question so I thought I'd re-ask it and see if it could get some additional feedback. We have multiple VERY extensive CSS files. We'd like to be able to dynamically switch between the CSS files at run time. So far the only solution that I have been able to come up with is to use the JSP Flex tag library to generate the main mxml application file and dynamically set the CSS file there. I only need to set this once, during the application initialization. If the CSS preference is changed, it is acceptable to restart the application. I saw some rather hackish ways of programmatically going through and resetting the style on individual items in the application, but this is very large application and that's just impractical. Ideally we just need to change the CSS. Is there no way to do this in MXML/ActionScript? Is this just a missing feature that we might expectfixed/added in a future version? Thank you, -- Matthew Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Re: [flexcoders] Dynamically Changing an entire CSS
Nope, you were right the first time; Flash does "compile" the CSS into the SWF; basically hardcodes the CSS value settings. The reason I said upload a new CSS to the server is that the Flex server, when a new request comes in for the MXML file, should detect the CSS file change, and generate a new SWF for the end user that will have the new CSS styles in it. - Original Message - From: Matthew Shirey To: flexcoders@yahoogroups.com Sent: Wednesday, April 06, 2005 2:34 PM Subject: Re: [flexcoders] Dynamically Changing an entire CSS Okay wait, let me get this right... Flex does not compile the css directly into the resulting swf? It reads the css at runtime? If that is true then you could write a jsp file that output the CSS. That css could change based on cookie or session type data. Does that sound like an option that might work? -- Matthew On Apr 6, 2005 10:25 AM, JesterXL [EMAIL PROTECTED] wrote: You cannot change CSS at runtime except via the setting of styles, as you have indicated. However, if restarting the application is acceptable, simply replace the CSS file on the server, and refresh the browser. - Original Message - From: Matthew Shirey To: flexcoders@yahoogroups.com Sent: Wednesday, April 06, 2005 1:13 PM Subject: [flexcoders] Dynamically Changing an entire CSS After searching the mailing list archives I cannot seem to find a good answer for this question so I thought I'd re-ask it and see if it could get some additional feedback. We have multiple VERY extensive CSS files. We'd like to be able to dynamically switch between the CSS files at run time. So far the only solution that I have been able to come up with is to use the JSP Flex tag library to generate the main mxml application file and dynamically set the CSS file there. I only need to set this once, during the application initialization. If the CSS preference is changed, it is acceptable to restart the application. I saw some rather hackish ways of programmatically going through and resetting the style on individual items in the application, but this is very large application and that's just impractical. Ideally we just need to change the CSS. Is there no way to do this in MXML/ActionScript? Is this just a missing feature that we might expectfixed/added in a future version? Thank you, -- Matthew Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Re: [flexcoders] Dynamically Changing an entire CSS
Right, but what I am trying to do requires the style to be selectable on a per user basis,from a profile setting. I have a workaround I am currently attempting. It's a little hackish, but doesn't require a ton of actionscript. If its successful then I'll share to this list. -- Matthew On Apr 6, 2005 11:39 AM, JesterXL [EMAIL PROTECTED] wrote: Nope, you were right the first time; Flash does compile the CSS into the SWF; basically hardcodes the CSS value settings. The reason I said upload a new CSS to the server is that the Flex server, when a new request comes in for the MXML file, should detect the CSS file change, and generate a new SWF for the end user that will have the new CSS styles in it. - Original Message - From: Matthew Shirey To: flexcoders@yahoogroups.com Sent: Wednesday, April 06, 2005 2:34 PM Subject: Re: [flexcoders] Dynamically Changing an entire CSS Okay wait, let me get this right... Flex does not compile the css directly into the resulting swf? It reads the css at runtime? If that is true then you could write a jsp file that output the CSS. That css could change based on cookie or session type data. Does that sound like an option that might work? -- Matthew On Apr 6, 2005 10:25 AM, JesterXL [EMAIL PROTECTED] wrote: You cannot change CSS at runtime except via the setting of styles, as you have indicated. However, if restarting the application is acceptable, simply replace the CSS file on the server, and refresh the browser. - Original Message - From: Matthew Shirey To: flexcoders@yahoogroups.com Sent: Wednesday, April 06, 2005 1:13 PM Subject: [flexcoders] Dynamically Changing an entire CSS After searching the mailing list archives I cannot seem to find a good answer for this question so I thought I'd re-ask it and see if it could get some additional feedback. We have multiple VERY extensive CSS files. We'd like to be able to dynamically switch between the CSS files at run time. So far the only solution that I have been able to come up with is to use the JSP Flex tag library to generate the main mxml application file and dynamically set the CSS file there. I only need to set this once, during the application initialization. If the CSS preference is changed, it is acceptable to restart the application. I saw some rather hackish ways of programmatically going through and resetting the style on individual items in the application, but this is very large application and that's just impractical. Ideally we just need to change the CSS. Is there no way to do this in MXML/ActionScript? Is this just a missing feature that we might expectfixed/added in a future version? Thank you, -- Matthew Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.