Sign in to follow this  
aslanlotter

external xml

Recommended Posts

I am not sure what I am doing wrong?

 

 

 

#include "com/fusioncharts/includes/LoadingFunctions.as"

 

#include "com/fusioncharts/includes/AppMessages.as"

 

//

 

import com.fusioncharts.core.charts.Column3DChart;

 

// ------------- XML Data for the chart -------------- //

 

var myXML:XML = new XML();

 

myXML.load("Column3D_virus2007.xml");

 

myXML.onLoad = function(success) {

 

if (success) {

 

var chartContainerMC:MovieClip = this.createEmptyMovieClip("ChartHolder", 1);

 

//

 

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

 

//Convey the XML data to chart.

 

myFirstChart.setXMLData(myXML);

 

//Draw the chart

 

myFirstChart.render();

 

}else{

 

trace("warning")}

 

};

 

//

 

stop();

 

 

 

Nothing get displayed? Can somebody help?

 

 

 

Best,

 

Martin

Share this post


Link to post
Share on other sites

Martin,

Please try debugging the movie to see what variables and objects are being instantiated? Also, what version of Flash are you compiling in?

Share this post


Link to post
Share on other sites

The scoping of code in your .fla is wrong.

When you write:

myXML.onLoad = function(success) {

 if (success) {

var chartContainerMC:MovieClip = this.createEmptyMovieClip("ChartHolder", 1);

the this here refers to myXML - and not _root. Please fix all the scoping errors.

Share this post


Link to post
Share on other sites

thx a lot for the help - it works now

 

#include "com/fusioncharts/includes/LoadingFunctions.as"

#include "com/fusioncharts/includes/AppMessages.as"

//

import com.fusioncharts.core.charts.Column3DChart;

// ------------- XML Data for the chart -------------- //

var myXML:XML = new XML();

myXML.load("Column3D_virus2007.xml");

myXML.onLoad = function(success) {

if (success) {

	var chartContainerMC:MovieClip = _root.createEmptyMovieClip("ChartHolder", 1);

	//

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

	//Convey the XML data to chart. 

	myFirstChart.setXMLData(myXML);

	//Draw the chart

	myFirstChart.render();

}else{

	trace("warning")}

};

//

stop();

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