Flash Sample Implementation - Anychart Flash Chart Component
If you want to embed AnyChart
into flash document you can use Action Script. Below
you can see the step by step tutorial:
1. Create new Flash document
2. Select frame
3. Open Actions-Frame window (press F9 or click Window
-> Actions)
4. Write this code into action window:
//create movieClip for holding chart
var chartContainer:MovieClip = this.createEmptyMovieClip('chartContainer',this.getNextHighestDepth());
//create string with xml
var xmlSource:String = "<?xml version='1.0'?><root><type><chart type='2DColumn' minimum_value='0'/></type><data><block><set value='10'/><set value='20'/><set value='30'/></block></data></root>";
//create AnyChart object instance
var anyChart:AnyChart = new AnyChart(chartContainer);
//override onLoad method
anyChart.onLoad = function():Void {
//set chart xml
this.setXMLSourceAsString(xmlSource);
}
//set swf
anyChart.setSWF('./swf/2DColumn.swf'); |
5. Store AnyChart.as in same folder (FLA file folder).
6. Press Ctrl + Enter.
Note:
If you want change chart data you should use AnyChart.setXMLDataAsString method.
If you want change chart appearance you should use AnyChart.setXMLSourceAsString method.
Final
Now you can use AnyChart Flash Component into your own
Flash movie.
Download our sample |