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

 < previousnext > 

 

External Variables

 

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

xml_source=sample.php?user_id=658&product=car 

 

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

xml_source=sample.php%3Fuser_id%3D658%26product%3Dcar

 

The result is:

'FlashVars', 'xml_source=sample.php%3Fuser_id%3D658%26product%3Dcar'

 

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


<?php

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

if ( $id == 658 ){ $x = 100; }
else { $x = 200; }

?>
							
<slickboard>
<rect fill_color='ff0000' /> 
<rect fill_color='00ff00' x='<?php print $x; ?>' />     
</slickboard>

 


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 © 2010-2017, maani.us