1 Reply Latest reply on Dec 21, 2009 9:39 AM by Ely Greenfield

    FXG library reuse in multiple MXML files


      Hello everyone,

      While playing around with Flex 4 I've come accross FXG reusibility issue.

      Here is what I would like to do. Suppose you have a Library.fxg file which contains the following content:



         <Definition name="RedRectagle">...</Definition>

         <Definition name="ComplexShape">..</Definition>



      So I wonder if there is a way to include this *.fxg file into *.mxml file somehow and then use those shapes that I've defind in the library as if the library were defined in the *.mxml file itself. For example:

      <?xml version="1.0" encoding="utf-8"?>

      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"



                     minWidth="800" minHeight="600">

         <!-- Somehow include that *.fxg file here or through defining namespace -->

         <!-- Now use shapes defined in the library -->




      The only similar *.fxg file inclution procees that I have found is:

      1. Defining XML namespace that points to the package where *.fxg files are located;
      2. Using whole *.fxg file as a single component;

      However this approach does not let you use shapes that are defined in the <Library/> tag and is totally useless if there is only FXG library defined in that *.fxg file and nothing more.

      In addition to that I'd like to know if there is a way to reuse content of one *.fxg file in another *.fxg file.