Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/03/2009, 14:21
supaya
 
Fecha de Ingreso: agosto-2002
Mensajes: 186
Antigüedad: 21 años, 8 meses
Puntos: 1
como hacer load de este archivo ??????

amigos quiero cargar este XML:
Código:
<chart palette='4'>
  <set label="Item A" value="4" /> 
  <set label="Item B" value="5" /> 
  <set label="Item C" value="2" /> 
  <set label="Item D" value="4" /> 
  <set label="Item E" value="5" /> 
  <set label="Item F" value="5" /> 
  <set label="Item G" value="4" /> 
  <set label="Item H" value="5" /> 
  <set label="Item I" value="2" /> 
</chart>
en una pelicula flash
esta pelicula flah tiene este scrip. que genera graficos pero quiero cambiar los datos internos por datos externos desde un xml


ayudenme por fa

Código:
/**
 * This keyframe contains the Actions required to load a FusionCharts
 * chart in your Flash movie.
 *
 * We've set the FPS of this movie to 120 for smooth animations.
 * Depending on your requirements, you can set any FPS. FusionCharts
 * renders time based animations, so the length of animation would stay
 * same. Only the smoothness would vary.
*/
//You first need to include the following two files in your movie.
//These two files contain pre-loading functions and application
//messages for the chart.

//Note: If you're loading multiple charts in your Flash movie, you
//do NOT need to include these files for each each. You can put these
//lines in the main timeline, so that it gets loaded only once.
#include "com/fusioncharts/includes/LoadingFunctions.as"
#include "com/fusioncharts/includes/AppMessages.as"

//To create the chart, you now need to import the Class of the 
//chart which you want to create. All charts are present in the package 
//com.fusioncharts.core.charts (Download Package > SourceCode folder)
//If you're using multiple charts, you can import all the requisite
//chart classes in the main timeline of your movie. That ways, you
//wouldn't have to import the chart classes everytime you wish to use.
import com.fusioncharts.core.charts.Column2DChart;

// ------------- XML Data for the chart -------------- //
//FusionCharts necessarily needs its data in XML format.
//So, if you've data in arrays, forms, recordsets, etc., you
//first need to convert it into XML. Only then would you be able
//to use the charts.

//Here, we're hard-coding an XML data document for demo.
//In your applications, this XML data could be dynamically
//built at run time using string concatenation or XML
//Object.
//Generate the XML data. We hide the border of chart, set background
//alpha as 0 (for transparency) and then set palette to 2.


var strXML:String = "<chart showBorder='0' bgAlpha='0,0' palette='1' caption='Hourly Working Rate' numberPrefix='$'>";
//Add simple data for demo.
strXML = strXML + "<set name='John' value='32' />";
strXML = strXML + "<set name='Mary' value='65' />";
strXML = strXML + "<set name='Michelle' value='29' />";
strXML = strXML + "<set name='Cary' value='43' />";
strXML = strXML + "</chart>"; 
//FusionCharts chart classes accept XML data as XML Object
//and not XML String.
//So, if you've an XML string, first create an XML object from it
//and then pass to the chart. We do the same.


var xmlData:XML = new XML(strXML);
// --------------------------------------------------- // 

// -------------- Actual Code to create the chart ------------//
//To create a chart, you first need to create an empty movie clip to act as chart holder.
var chartContainerMC:MovieClip = this.createEmptyMovieClip("ChartHolder",1);
//Now, instantiate the chart using Constructor function of the chart.
/**
* @param	targetMC	Movie clip reference in which
*						the chart will create its own movie clip.s
* @param	depth		Depth inside parent movie clip in which
*						the chart will create its own movie clips.
* @param	width		Width of chart
* @param	height		Height of chart
* @param	x			x Position of chart
* @param	y			y Position of chart
* @param	debugMode	Boolean value indicating whether the chart
*						is in debug mode.
* @param	lang		2 Letter ISO code for the language of application
*						messages. Depends on what data you've fed.
* @param	scaleMode	Scale mode of the movie - noScale or exactFit
*/
var myFirstChart:Column2DChart = new Column2DChart(chartContainerMC, 1, 450, 325, 20, 15, false, "EN", "noScale");
//Convey the XML data to chart. 
myFirstChart.setXMLData(xmlData);
//Draw the chart
myFirstChart.render();
//Stop
stop();