1 Reply Latest reply on Jul 3, 2010 1:48 AM by Kartik Mehta

    Flash Pro CS5  Convert to Flex Component and SWC export

    FM_Flame Level 1

      Hi,

       

      my question is about the Flash Pro CS5 and Flash Builder 4 (Flex 4) integration.

       

      My goal is simple - to make a simple graphic in a MovieClip and then export that for use in Flash Builder 4. I found out I have 2 ways of doing that:

      1) -> create the MovieClip with the graphic

          -> export it for ActionScript with a name of the class

          -> select the symbol in the library again and export SWC file. Total size of this SWC in my example is 24kb.

          -> put the SWC in the libs folder and use the class/component which should be put inside SpriteVisualContainer or UIMovieClip

       

      2) -> create the MovieClip with the graphic

          -> export it for ActionScript with a name of the class

          -> select it in the libraly and then select Commands -> Convert Symbol to Flex Component

      Now here we can do 2 things:

          -> select the symbol in the library and export SWC file. Total size here is 104kb.

          -> publish the whole project and use its SWC file.

      And last:

          -> put the SWC in the libs folder and use the class/component wherever you want because it's already extending UIMovieClip.

       

      So My point is that with the first way I need to use just one simple container to put my component into and I save like 80 kb. Why would I want to use the second way, just to be more comfortable or there are other reasons too?

       

      I was thinking that maybe I could put more flex converted components in the fla file so I would then export the swc with all of them being already flex components and that 80kb will be shared for all of them, which makes sense of using this feature, but if someone could confirm my thinking is right or there was some other better purpose or way of doing things in an optimised way, I will be glad to hear them. Thanks!