AnyChart Preloader SWF
Overview
Preloader swf is a special SWF file that makes loading AnyGantt SWF more comfortable with a slow Internet Connection and provides some useful customization settings.
In this tutorial we will show how to use and configure the preloader.
Using Preloader
The best way to implement the preloader is to utilize AnyGantt(swf, preloader) constructor from AnyGantt JavaScript Integration Library. The code in JS Script should look like that:
//<![CDATA[
var chart = new AnyChart('./swf/AnyGantt.swf', './swf/preloader.swf');
chart.width = 600;
chart.height = 300;
chart.preloaderLoadingText = "%E7%E0%E3%F0%F3%E7%EA%E0...";
chart.setXMLFile('./data.xml');
chart.write();
//]]>
</script>
You can use preloader swf with simple HTML embedding like that:
width="600" height="300">
<param name="movie" value="swf/preloader.swf" />
<param name="flashvars"
value="XMLFile=data1.xml&swffile=./swf/AnyGantt.swf" />
<embed
type="application/x-shockwave-flash"
src="swf/preloader.swf"
flashvars="XMLFile=data1.xml&swffile=./swf/AnyGantt.swf"
width="600" height="300">
</embed>
</object>
Launch the preloader sample - it demonstrates both JS and HTML embedding - you can see the percents showing swf loading state (if you will place this sample on the web site and open a page with using slow Internet connection channel).
Open the folder with sample: Preloader Sample.
Preloader Features
You can customize text to show in preloader and while AnyGantt initializes. You can configure the following texts:
Parameter | Description |
---|---|
preloaderInitText | Text to be shown on preloader initialization (if preloader is used). Default: "Initializing..." |
preloaderLoadingText | Text to be shown while AnyGantt is loading AnyGantt.Swf Default: "Loading... " |
initText | Text to be shown while AnyGantt is initializing Default: "Initializing..." |
xmlLoadingText | Text to be shown while AnyGantt is loading XML Data. Default: "Loading xml..." |
resourcesLoadingText | Text to be shown while AnyGantt is loading resources (images, etc.) Default: "Loading resources..." |
noDataText | Text to be shown when AnyGantt gets gantt chart without data. Default: "No Data" |
waitingForDataText | Text to be shown when AnyGantt gets no data source (neither XMLFile nor XMLText is set to chart) |
templatesLoadingText | Text to be shown while AnyGantt is loading gantt chart templates Default: ""Loading templates..."" |
To set your own initialization strings you can use AnyGantt JavaScript Library properties or preloader and AnyGantt SWF parameters.
In preloader sample we've set custom texts for "preloaderLoadingText" - it will show message in Russian, you can use language or text of your choice.