Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Cannot access null object in GraphmlConverter

Flare Help
2012-01-23
2013-05-29
  • tharanprabhu
    tharanprabhu
    2012-01-23

    Hi,
                  I am new to Flare. i tried to execute my first example in flare. but it showing error given  below
                 
                 TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at flare.data.converters::GraphMLConverter/parseData()
    at flare.data.converters::GraphMLConverter/parse()
    at GraphmlTest2()
    at FlareDemo/init()

           Here  i have attached the code too for your review. Please help me. It would be help full .

         package
    {
    import flare.data.DataSchema;
    import flare.data.DataSet;
    import flare.data.converters.GraphMLConverter;
    import flare.vis.Visualization;
    import flare.vis.data.Data;
    import flare.vis.operator.layout.RandomLayout;

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

    public class GraphmlTest2 extends Sprite{

    private var vis:Visualization = null;
    public function GraphmlTest2()
    {
    var xmlData:XML = <graphml> 
    <graph id="G" edgedefault="directed">
    <node id="n0" name="SALES"/> 
    <node id="n1" name="Revenue"/>
    <node id="n2" name="Airtel"/> 
    <node id="n3" name="Aircel"/> 
    <node id="n4" name="BSNL"/> 
    <node id="n5" name="Vodafone"/> 
    <node id="n6" name="Spice"/> 
    <node id="n7" name="MTNL"/> 
    <node id="n8" name="Reliance"/>
    <node id="n9" name="IDEA"/> 
    <node id="n10" name="IVR"/> 
    <node id="n11" name="SMS"/> 
    <node id="n12" name="IVR"/> 
    <node id="n13" name="SMS"/>
    <node id="n14" name="IVR"/> 
    <node id="n15" name="SMS"/>
    <node id="n16" name="IVR"/> 
    <node id="n17" name="SMS"/> 
    <node id="n18" name="IVR"/> 
    <node id="n19" name="SMS"/> 
    <node id="n20" name="IVR"/>
    <node id="n21" name="SMS"/> 
    <node id="n22" name="IVR"/>
    <node id="n23" name="SMS"/> 
    <node id="n23" name="IVR"/> 
    <node id="n24" name="SMS"/> 
    <node id="n25" name="IVR"/> 
    <node id="n26" name="SMS"/>
    <node id="n27" name="WAP"/> 
    <node id="n28" name="USSD"/>
    <edge id="e2" source="n0" target="n1" type="type2"/> 
    <edge id="e3" source="n1" target="n2" type="type3"/> 
    <edge id="e4" source="n1" target="n3" type="type4"/> 
    <edge id="e5" source="n1" target="n4" type="type5"/> 
    <edge id="e6" source="n1" target="n5" type="type6"/> 
    <edge id="e7" source="n1" target="n6" type="type7"/> 
    <edge id="e8" source="n1" target="n7" type="type8"/>
    <edge id="e9" source="n1" target="n8" type="type7"/> 
    <edge id="e10" source="n1" target="n9" type="type8"/>
    <edge id="e11" source="n2" target="n11" type="type10"/>
    <edge id="e12" source="n3" target="n12" type="type9"/>
    <edge id="e13" source="n3" target="n13" type="type10"/>
    <edge id="e14" source="n4" target="n14" type="type9"/>
    <edge id="e15" source="n4" target="n15" type="type10"/>
    <edge id="e16" source="n5" target="n16" type="type9"/>
    <edge id="e17" source="n5" target="n17" type="type10"/>
    <edge id="e18" source="n6" target="n18" type="type9"/>
    <edge id="e19" source="n6" target="n19" type="type10"/>
    <edge id="e20" source="n7" target="n20" type="type9"/>
    <edge id="e21" source="n7" target="n21" type="type10"/>
    <edge id="e22" source="n8" target="n22" type="type9"/>
    <edge id="e23" source="n8" target="n23" type="type10"/>
    <edge id="e24" source="n9" target="n24" type="type9"/>
    <edge id="e25" source="n9" target="n25" type="type10"/>
    <edge id="e26" source="n2" target="n26" type="type10"/>
    <edge id="e27" source="n2" target="n27" type="type10"/>
    <edge id="e28" source="n2" target="n28" type="type10"/>
    </graph>
    </graphml>  ;
    var gmlConverter:GraphMLConverter = new GraphMLConverter();
    var dataSet:DataSet = gmlConverter.parse(xmlData,null);

    vis = new Visualization(Data.fromDataSet(dataSet));
    vis.operators.add(new RandomLayout());
    vis.update();
    this.addChild(vis);

    }

    public function loadData(xmldata:XML):void {

    }
    }
    }