4 Replies Latest reply on Jan 10, 2011 12:07 AM by 2rancho

    Is there an equivalent of CSS technology in flash?

    2rancho

      Hi

      At the very outset let me apologize if my question is not in the right group here. Just like how one can use different CSS files to view the same text rendered differently in HTML. I would like to find how to do the same with Flash. My goal is to create multiple flash document templates, without the content in them ( similar to CSS ) and i be able to load content dynamically into them thru external data files. 

      Any pointers will be greatly appreciated?

       

      Thank you

        • 1. Re: Is there an equivalent of CSS technology in flash?
          Andrei1 Level 6

          Flash has very limited native support for CSS in TextField. Flex (which is, basically, extended libraries written based on AS3) has a much wider CSS support. Otherwise one can write his own routine to apply external CSS to objects.

           

          "My goal is to create multiple flash document templates, without the content in them ( similar to CSS ) and i be able to load content dynamically into them thru external data files."

           

          I am not sure what you are trying to accomplish because it is not an accurate description of how CSS is used in HTML documents.

           

          External data can be loaded in XML, AMF, JSON or any other text format.

          • 2. Re: Is there an equivalent of CSS technology in flash?
            2rancho Level 1

            Hi Andrei1,

            Thanks for the prompt reply. Maybe i was not very clear on my first attempt , my apologies for that. This is what i intend to do. I need to create multiple document templates in flash , with no text in them and have them loaded at run time. An example would be visiting  cards , lets say there are multiple empty flash templates of such visiting cards, the text of which is in an external file. This way if i change the text in the external file  and the flash document reflects the changes automatically, ( hence the reference to CSS )

            From your reply above it seems there seems to be a way to do it. Can you point me to some examples to the same. I am picking up Flex as we speak, so pointers here would help too.

             

            Thank you

            • 3. Re: Is there an equivalent of CSS technology in flash?
              Andrei1 Level 6

              External text data needs to be displayed in some object. In Flash it is displayed in TextField instance. So, even if there is no text - you need placers for the text that is loaded (again, placers are TextField instances).

               

              In addition, "automatically" means that you will have to load files with data at runtime.

               

              CSS is designed to manipulate appearance - not content.

               

              Here is documentation for TextField:

               

              http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/text/TextField.html

               

              There are plenty of examples on teh web. It seems you would benefit from tutorials on Flash/ActionScript basics.

              • 4. Re: Is there an equivalent of CSS technology in flash?
                2rancho Level 1

                Thanks Andrei!, This sure is of great help. As you could have guessed i am still a novice here .

                 

                Greatly appreciate the right direction.