TEX Report post Posted February 28, 2007 The Knowledge Base Q10068 - "HOWTO: I want to load an external XML file inside my chart loaded in a Flash movie/application" (http://www.fusioncharts.com/KB/article.aspx?id=10068&cNode=1F3K5Y) shows how to load data from external file, but id doesnt works on my SWF file. The source is: -------------- #include "com/fusioncharts/includes/LoadingFunctions.as" #include "com/fusioncharts/includes/AppMessages.as" import com.fusioncharts.core.charts.Pie3DChart; XMLFile = "Pie3D.xml"; var xmlData:XML = new XML(); xmlData.load(XMLFile); xmlData.onLoad = function(exito) { if (exito){ trace(xmlData) var chartContainer1MC:MovieClip = this.createEmptyMovieClip("ChartHolder1", 1); var chart1:Pie3DChart = new Pie3DChart(chartContainer1MC, 1, 380, 325, 20, 15, false, "EN", "noScale"); chart1.setXMLData(xmlData); chart1.render(); } else trace("Where is " + XMLFile + "?"); }; stop(); -------- PD: the smile is ": P", [ code ][ / code ] doesnt works with the emoticons. If you publish the movie the charts doesnt appears on the movie. Any suggestion? Thanks. Share this post Link to post Share on other sites
ethodaddy Report post Posted March 13, 2007 having the same issue as Tex. anyone have an answer for us? Tex did you solve this issue? etho Share this post Link to post Share on other sites
ethodaddy Report post Posted March 13, 2007 update to previous post: wanted to point out that I would like to make the graph use dataURL rather than a flat xml file. thanks Share this post Link to post Share on other sites
Pallav Report post Posted March 14, 2007 You'll need to load the XML file in your custom XML objects in Flash and then pass that XMl to the loaded chart. Share this post Link to post Share on other sites
varoon Report post Posted October 21, 2008 can u show me a sample to load a external xml in flash... ? Share this post Link to post Share on other sites
orenji Report post Posted February 21, 2009 Pallav (3/14/2007)You'll need to load the XML file in your custom XML objects in Flash and then pass that XMl to the loaded chart. How to do this?? can you give me the example? Share this post Link to post Share on other sites
naransim Report post Posted March 4, 2009 Hello, I made some changes to the code: XMLFile = "datos.xml"; var xmlData:XML = new XML(); xmlData.ignoreWhite = true; xmlData.load(XMLFile); xmlData.onLoad = function(exito) { if (exito){ trace(xmlData) } else trace("Where is " + XMLFile + "?"); }; var chartContainer1MC:MovieClip = this.createEmptyMovieClip("ChartHolder1", 1); var chart1:MSColumn3DChart = new MSColumn3DChart(chartContainer1MC, 1, 380, 325, 20, 15, true, "EN", "noScale"); chart1.setXMLData(xmlData); chart1.render(); stop(); I get the debugger to work, the xml traces perfectly, but syill no char snowing...please try this an see the debuging message: Info: Chart loaded and initialized. Initial Width: 380 Initial Height: 325 Scale Mode: noScale Debug Mode: Yes Application Message Language: EN Version: 3.0.2 Chart Type: Multi Series 3D Column Chart Chart Objects: BACKGROUND CANVAS CAPTION SUBCAPTION YAXISNAME XAXISNAME DIVLINES YAXISVALUES DATALABELS DATAVALUES TRENDLINES TRENDVALUES DATAPLOT TOOLTIP VLINES LEGEND ERROR: No data to display. There isn't any node/element in the XML document. Please check if your dataURL is properly URL Encoded or, if XML has been correctly embedded in case of dataXML. No Data to Display: No data was found in the XML data document provided. Possible cases can be: There isn't any data generated by your system. If your system generates data based on parameters passed to it using dataURL, please make sure dataURL is URL Encoded. You might be using a Single Series Chart .swf file instead of Multi-series .swf file and providing multi-series data or vice-versa. Share this post Link to post Share on other sites
naransim Report post Posted March 4, 2009 Hello again, I managed to make it work, not loading an xml but putting the xml code inside flash: var strXML:String = "pasteheretheXMLfilecontentwithnospaces"; var xmlData:XML = new XML(strXML); var chartContainerMC:MovieClip = this.createEmptyMovieClip("ChartHolder",1); var myChart:MSColumn3DChart = new MSColumn3DChart(chartContainerMC, 1, 450, 325, 5, 38, false, "EN", "noScale"); myChart.setXMLData(xmlData); myChart.render(); the thing is that the xml should be with no spaces, I've made the same for the xml file but it didn't work, it has to be done inside flash.....hope this work for you too. Share this post Link to post Share on other sites