XML/SWF Charts| CSS/XML Timeline Eons(New)| Timeline Eons| SlickBoard

 < previousnext > 

 

External Variables

 

Pass variables from the web page to the XML source like this:

xml_source=sample.php?chart_type=bar&user_id=658 

 

To avoid conflicts with other FlashVars variables, convert the special characters to their hex values like this:

xml_source=sample.php%3Fchart_type%3Dbar%26user_id%3D658

 

The result is:

'FlashVars', 'library_path=charts_library&xml_source=sample.php%3Fchart_type%3Dbar%26user_id%3D658'

 

The sample.php source might read the variables and generate the XML code like this:


<?php

//read the query variables
$type =  $_REQUEST['chart_type'];
$id = $_REQUEST['user_id'];

//make it a line chart for all users other than user id 658	
if ( $id != 658 ){
   $type = "line";
}

?>
							
<chart>
<chart_type><?php print $type ?></chart_type>
</chart>

 


Limits

The amount of variables passed to the xml_source URL via FlashVars might have limits on some browsers. These limits are not documented. Try a few variables and verify that they work on all browsers, then gradually add more.

Ideally, the xml_source should contain scripts that collect data and variables from databases and other sources, limiting the use of FlashVars.

 

 

 < previousnext > 


Copyright © 2003-2017, maani.us