4 Replies Latest reply on Jun 25, 2010 1:08 PM by Shongrunden

    FXG : Multiple Definitions in a Library tag

    Jean Demonceau Level 1

      Hi.

      I'm testing FXG to build my Flex 4 design.

      In Illustrator CS4, I make some symboles then I save the file as FXG myFxg.fxg.

      I copy/paste the file in FlashBuilder 4.

       

      In my FXG File I have :

       

      ...

      ...

      <Library>
          <Definition name="blue">
            <Group >
              <Group x="-98" y="-20" d:id="2" scaleGridLeft="49" scaleGridRight="147" scaleGridTop="30" scaleGridBottom="10">
                <Path winding="nonZero" ai:knockout="0" data="M196 40L0 40 0 0 196 0 196 40Z" >
                  <fill>
                    <LinearGradient x="98" scaleX="40" rotation="90">
                      <GradientEntry color="#0000ff" ratio="0"/>
                      <GradientEntry color="#000000" ratio="0.751515"/>
                      <GradientEntry color="#0000ff" ratio="1"/>
                    </LinearGradient>
                  </fill>
                </Path>
              </Group>
            </Group>
          </Definition>
          <Definition name="red">
            <Group >
              <Group x="-98" y="-20" d:id="3" scaleGridLeft="49" scaleGridRight="147" scaleGridTop="30" scaleGridBottom="10">
                <Path winding="nonZero" ai:knockout="0" data="M196 40L0 40 0 0 196 0 196 40Z" >
                  <fill>
                    <LinearGradient x="98" scaleX="40" rotation="90">
                      <GradientEntry color="#ff0000" ratio="0"/>
                      <GradientEntry color="#ffffff" ratio="0.751515"/>
                      <GradientEntry color="#ff0000" ratio="1"/>
                    </LinearGradient>
                  </fill>
                </Path>
              </Group>
            </Group>
          </Definition>
        </Library>

      ..

      ...

       

      FlashBuilder allows me to write <myFxg/> and all symboles are drawn correcly.

      How can I do to use only one of these symbole. I would like to be able to write something like : <blue/> or <red/> But I don't want to save a FXG File per symbole.

       

      Any idea ?