Sign in to follow this  
jmarkus

loading FusionCharts inside other Flash with external XML file

Recommended Posts

Hi all,

 

I was browsing through the documentation and in this page you describe a scenario I need to do (load charts inside a flash movie) but you pass XML data only inside the movie's actionscript (using var strXML:String etc). I was wondering, is it possible to have a flash movie load the fusion chart inside it and take all XML data from an external .xml file? I see this is done in other scenarios where fusionchart swfs are embedded in HTML pages, but it's not mentioned here and I can't see how a path to the .xml file can be inserted in the actionscript instead of the actual xml data using var strXML:String. Thanks.

Share this post


Link to post
Share on other sites

Hi,

You can always load and pass valid XML to a chart em,bedded in a Flash movie.

All you need to do is to use the XML.load()

Please find the attached sample code :

All you need to do is:

 

//use XML object  to load external XML

// when done (onLoad event) render the chart using this XML)

var xmlData:XML = new XML();

// define event handler for XML object

// this calls a functrion when the external XML gets loaded in XML object.

// renderChart() function will be called

xmlData.onLoad = function(success) {

 

renderChart(xmlData);

};

// load external XML

xmlData.load("external.xml");

function renderChart(xmlData){

var myFirstChart:Column3DChart = new Column3DChart(chartContainerMC, 1, 450, 325, 20, 15, false, "EN", "noScale");

myFirstChart.setXMLData(xmlData);

myFirstChart.render();

}

MyFirstChart_EnternalXML.zip

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this