6 Replies Latest reply on Jul 21, 2009 1:39 PM by Philippe Chaurand

    FXG to SWF compilation

    Philippe Chaurand

      Hi,

       

      One thing which is very annoying, is that I need to break apart an optimized graphic to modify it, then I ve to convert it again.

       

      When I convert something in optimized graphic it produces two files : one is FXG which is editable with Illustrator, and the other is SWF (the compiled version of the first). Why do we need this SWF file ? In Flash Builder, FXG can be used directly ...

       

      Anyway, I think I d find a workaround: how can I compile FXG files to SWF files ? I tried with 'mxmlc' from the Flex 4 SDK but the SWF file was bad ...

       

      Cheers.

       

      PS: I m on OS X

        • 1. Re: FXG to SWF compilation
          ryanstewartadobe Adobe Employee

          Hey Phillipe, it looks like you may have gotten this answered - http://forums.adobe.com/message/2078163#2078163

           

          The SWF file is the external asset and the FXG file is part of the project. When a Flex project is compiled all of the FXG files are compiled into SWF files. The SWF is used by Catalyst to render the project but the FXG is just the code so that when you bring it into Flash Builder you have everything.

           

          But to answer what I think is your main question, the SWF file is there so that Catalyst can use it when you run the project and test it in the browser.

           

          =Ryan

          ryan@adobe.com

          • 2. Re: FXG to SWF compilation
            andre49

            Hi Ryan,

             

            Philippe is really a disgusting individual .

             

            He made me lose one hour of my precious time and also yours.

             

            The facts clearly demonstrate that he was acting in bad faith. He neither replied to your post or mine.

             

            He never had any intention to do so.

             

            He specializes in posting nebulous statements in order to trick the flash community.

             

            He made the mistake to link Catalyst and Flex board.

             

            Sorry for you Philipe. You're caught.

             

            You think you're smart. You're Wrong.

             

            You'd better respect your fellow community partners.

             

            Stop tricking them and made them waste their precious time

             

            Don't do to others what you would not like others do to you.

             

            Next time I catch you, I make an abuse report.

             

            Please take good note.

             

            Cheers,

             

            andre49

            • 3. Re: FXG to SWF compilation
              Philippe Chaurand Level 1

              Hi,

               

              Yeah, exporting FXG to AI in Illustrator and AI to SWF in Flash CS4 solved my problem : but it is a huge workaround. I d like something automated : that s why I though about command-line compilation with Flex SDK.

               

              In fact, I d like to create an AIR application which re-compile every FXG of the Catalyst project, so I need a command-line like "path/to/flex/sdk/mxmlc -output MyFile.swf MyFile.fxg" to do so.

               

              What kind of Catalyst scenario do I think ?

              1 - a made an optimized graphic for a popup background for example (so I ve got a FXG and SWF file in my Catalyst project)

              2 - I give the Catalyst project to the developper who use this graphic to skin a popup in their new Flash Builder project

              3 - but later, I want to modify it without breaking it apart, so I open with Illustrator the corresponding FXG file from the "code" view

              4 - after adding changes and saving the FXG file, I use my AIR application to compile/update the SWF file used by Catalyst

              5 - I refresh the artboard on Catayst and changes appear

              6 - I use my AIR application to update the Flash Builder project to send changes to developpers

               

               

              Tell me if I m clear or not (im french ...) ?

              Cheers.

               

               

              PS: as I m french, when it s 11am, it s 6pm in France, that s why I m off ...

              PS2: when I realized that my question didnt fit to the Catalyst forum (because of its technical nature), I decided to post on Flex SDk forum. It s double-posting, it s bad, i know ... sorry ...

              • 4. Re: FXG to SWF compilation
                andre49 Level 1

                Hi Philippe,

                 

                I red your comments three or four times.

                 

                I think I am getting pretty well the picture now.

                 

                I will stay on the Flash Catalyst discussion board.

                 

                I am assuming that you are a designer with minimal programming knowledge of Flash CS4 or Flash Builder 4.

                 

                Am I right?

                 

                Your main goal is to cut off the manual compilation in Illlustrator CS4 and compiling your FXG file throuh an AIR program in Flex Builder 4 to save time.

                 

                However, you've already tried programmatically to compile your FXG file in Flex Builder 4 through a simple command line but the result was unsatisfactory or bad as you call it.

                 

                The SWF file manually compiled by Illustrator CS4 was also unsatisfactory.

                 

                However, importing your FXG file in flash CS4 and running it produced satisfactory results.

                 

                I am assuming here that you owe or have access at both applications Flash Builder 4 and Flash CS4. If you have an ealier version of Flash Builder 4 i.e Flex 3 or older, Please let us know.

                 

                I am new to Flash Builder 4 but consider myself somewhere between intermediate to advanced in Flash CS4 Action Script 3 programming language.

                 

                Here is my evaluation of your situation.

                 

                As far as I am concerned an AIR application to programmatically compile your FXG file to an SWF one by simply entering a single command line giving the FXG sourcePath could  be created in Flash CS4.

                 

                Both Flash CS4 and Flash Builder 4 can create AIR applications.

                Concerning your Flash Builder 4 option, I am welcoming competent programmers to add their ideas on it for now.

                 

                I think I have a pretty good idea how to create your application.

                However, since there is a non negligible amount of time and a lot of unknown in the process  that would be needed for coding and testing.

                I am  presently not willing to engage my responsibility particularly for free on your application. You would require the professional services of a competent programmer.

                 

                However, with this first evaluation,  I think I have at least made the analysis of your AIR application clearer.

                 

                Good luck,

                 

                andre49,

                • 5. Re: FXG to SWF compilation
                  Philippe Chaurand Level 1

                  Hi


                  Thanx for your replies. After talking with workmates, I realized that my question was badly written.

                   


                  MY REAL QUESTIONS :

                  • How Catalyst creates SWF files for the optimized graphics ?
                  • Can I do the same with the command-line compiler of the Flex 4 SDK ?

                   

                   

                   

                  Cheers, hope it s better now ...

                  • 6. Re: FXG to SWF compilation
                    Philippe Chaurand Level 1

                    Hi,

                     

                    I wrapped my FXG file into WrappedGraphic.mxml :

                     

                    <?xml version="1.0" encoding="utf-8"?>
                    <mx:Application backgroundAlpha="0" paddingBottom="0" paddingLeft="0" paddingRight="0" paddingTop="0" layout="vertical"
                            xmlns:mx="library://ns.adobe.com/flex/halo"
                            xmlns:s="library://ns.adobe.com/flex/spark"
                            xmlns:d="http://ns.adobe.com/fxg/2008/dt"
                            xmlns="http://ns.adobe.com/fxg/2008"
                            xmlns:fc="http://ns.adobe.com/thermo/2009"
                            xmlns:th="http://ns.adobe.com/thermo/2009"
                            xmlns:assets="assets.*" width="100%" height="100%">


                         <mx:Image source="@Embed('assets/MyOptimizedGraphic.fxg')" maintainAspectRatio="true" th:isFXGAsset="true" width="100%" height="100%"/>


                    </mx:Application>

                     

                     

                    so :

                    1 - I edit MyOptimizedGraphic.fxg with Illustrator

                    2 - I launch this command-line in my OSX terminal : "path/to/flex/sdk/mxmlc WrappedGraphic.mxml"

                    3 - I get a new SWF file which can replace the old MyOptimizedGraphic.swf

                    4 - I refresh artboard in Catalyst

                    5 - It s working well in Catalyst

                    6 - when I run the Catalyst project, everything is ok

                    7 - I change the size of my optimized graphic in Catalyst : if I run the project, the size of my optimized graphic does not change .... any idea ?

                     

                     

                     

                    Thanx.