|
Search:
Advanced search
|
Browse by category:
|
Loading the Chart into Another Flash Movie |
|||
Loading the Chart into Another Flash MovieNormally, the chart is embedded in HTML. However you can load it as a movie clip inside another Flash movie. This requires knowledge of Macromedia Flash! To insert the chart into your movie, paste the following code snippet into your Flash project: var listener:Object = new Object();
listener.onLoadInit = function(target_mc:MovieClip):Void {
target_mc.path = "ampie/";
target_mc.settings_file = "ampie/ampie_settings.xml";
target_mc.data_file = "ampie/ampie_data.xml";
target_mc.flash_width = "550";
target_mc.flash_height = "400";
}
var loader:MovieClipLoader = new MovieClipLoader();
loader.addListener(listener);
this.createEmptyMovieClip("ampie_mc", this.getNextHighestDepth());
loader.loadClip("ampie/ampie.swf", this.ampie_mc);
This code can work without modification under two conditions:
If this is not the case, you will need to change the paths and file names in the code snippet above. Alignment and scale When chart is loaded to your parent swf, stage alignment will be changed to "TOP-LEFT". if you don’t want this to happen, add this line to you onLoadComplete function: target_mc.align = ""; The same with scaling - if you don’t want to use "noScale", add this line: target_mc.scale = ""; You can find an example of the loader file here. |
|||
Comments
|
21 Jan, 2008
|
marcelionis
|
|
amCharts are programmed with AS2, and I am afraid there is no way to load them to flash file compiled with AS3 |
|
19 Jan, 2008
|
atle
|
|
Do you have any examples for AS3? Preferrably showing how to pass parameters from within the actionscript file, not via external files. |
| Others in this Category | |
| Javascript Controls | |
| Image Export Scripts | |
Powered by
KBPublisher (Knowledge base software)