3 Replies Latest reply on Jul 8, 2011 7:37 AM by m4cG33k

    Importing FXG Into Flex Application

    m4cG33k

      I'm currently working on a SWF that is being built using the open source Flex 4.5.x SDK.  Part of the project requires that I import graphics in FXG format.  Since this is my first time handling this kind of import, I decided to build a sample in the Flash IDE (the FXG document was a simple export from AI):


      import flash.net.URLLoader;
      import flash.net.URLRequest;
      import flash.events.Event;

       

      var fxgLoader:URLLoader = new URLLoader();

       

      fxgLoader.addEventListener(Event.COMPLETE, function(e:Event):void{
          trace("fxg file loaded!");
          parseFxg(new XML(e.target.data));
      });

       

      trace("begin loading fxg file...");
      fxgLoader.load(new URLRequest("icons.fxg"));

       

      function parseFxg(fxgData:XML){
          trace("begin parsing fxg xml data...");
          var groupList:XMLList = fxgData.Group;
          trace(groupList.length());
      }

       

      Unfortunately, the groupList variable does not appear to be getting the correct scope because it keeps returning 0 instead of 7.  Is this the best way to undertake this kind of import or is there a more efficient way?

       

      Thanks for your help!