Can CSS file load dynamically?

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default Can CSS file load dynamically?

    We have a large application.
    In our design, we make the whole application as one mxml application, and the
    other modules are the mxml components to be load into the mxml application.
    And, we have a lot of styles, we put them in serveral .CSS files, one file is
    used for one module.
    Now since we have only one mxml application, and in flex, .CSS can be only
    included in mxml application but not mxml components, we have to include all
    these css file in the largest application.
    We use tag as <mx:Style source="../theme/XXX.css"/>
    It seems the size of the CSS will be counted into the compiled as file, so it
    often exceeds the size limitation of 32K(We have CSS files total size more than
    12K, and this size will increase as we develop more and more modules).
    Is there any approach to load the css file dynamically to avoid the exceed
    size limitation?

    xiva Guest

  2. Similar Questions and Discussions

    1. Load Image Dynamically
      Hi, brothers :) I'm rather novice in this area. I mean web programming and control building and though. I create UserControl: public class...
    2. Dynamically load of 3d models
      Hi! I'm about to create a larger realtime 3d project. I havn't completely decided on which technology to use, but my first choice is director....
    3. Best way to dynamically load jpegs?
      I am new to Flash and actionscript and just getting my feet wet learning how to put the pieces together. I would like to dynamically load series of...
    4. Dynamically load an ASP Page
      I'm pretty new to ASP.Net (server side) Suppose that I have an instance of an ASP Page class, and I want the client's web browser to load it. I...
    5. How to dynamically load new image to cast member from file..
      I'm trying to load a new image from a file into an existing cast member during run-time and I'm sure not sure how to do this. Can you help? ...
  3. #2

    Default Re: Can CSS file load dynamically?

    Per Gordon Smith of Macromedia:

    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

    ntsiii Guest

  4. #3

    Default Re: Can CSS file load dynamically?

    Also, the 32k limit is not what you think. See this link:
    [url]http://www.cflex.net/showfaq.cfm?ChannelID=1&faqType=#Question365[/url]

    Tracy
    ntsiii Guest

  5. #4

    Default Re: Can CSS file load dynamically?

    Thanks for the help from Gordon & Tracy.
    One more question: How can I know the size of the compiled file?
    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.
    Sorry I can't catch the meaning of the above words well...
    1. What is 'user profiles'?
    2. How can I save them as XML files?



    xiva Guest

  6. #5

    Default Re: Can CSS file load dynamically?

    Gordon was replying to another persons need for user configurable styles. What
    that means to you is that instead of dynamic css, store the style
    specifications in an xml file, then on initialize, use the xml data to know how
    to use setStyle().

    What "compiled file" do you want to know the size of?

    Tracy

    ntsiii Guest

  7. #6

    Default Re: Can CSS file load dynamically?

    Originally posted by: ntsiii
    Gordon was replying to another persons need for user configurable styles.
    What that means to you is that instead of dynamic css, store the style
    specifications in an xml file, then on initialize, use the xml data to know how
    to use setStyle().

    What "compiled file" do you want to know the size of?

    Tracy

    Hi, Tracy, firstly I don't know how to load styles in XML format, and how to
    parse them. I can't image how to perform this task //shy
    I mean, the 32k limitation is not for the source file, but for the generated
    files.How can I know how large the generated file is?If I do some modifications
    in the source file, can it reduce the generated file's size effectively?


    xiva Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139