PHP->FLASH

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Here's hoping one of the savvy PHP participants is also skilled with FLASH, the following variables are output to the browser as:

&thePrices=partCD +Player&thePrices=price320&thePrices=partShocks&thePrices=price450&thePr ices=partCa r+Cover&thePrices=price500

The desired name/value pairs...............

In FLASH this is returned to the output window:
price500

Should I store the values in an array in FLASH, then loop through them, if so how, as my attempt returned the same price500?

PHP5 simpleXML object:


<?php
//Create path to document
$doc="./priceList.xml";
global $thePrices;
//load document.
$xml=simplexml_load_file($doc);
//echo $xml->asXML() . '<br />';
//loopthrough names and prices.
//echo $xml->getName() . '<br />';
foreach ($xml->children() as $child){
	echo $child->getName(). ": " . $child . '<br />';
	$thePrices.= "&thePrices=".	(urlencode($child->getName() . $child));
	}

echo $thePrices;
/*
$thePrices .= (urlencode($child->getName() . $child));
'thePrices'=$thePrices;
*/


?>

Actionscript:


//Create the LoadVars instance to retrieve the prices from the PHP script.
var getPrices:LoadVars=new LoadVars();
//load prices from PHP.
getPrices.load("http://localhost/~username/folderpath/autoPrices/ pricesFlash.php?ck=" + new Date().getTime());
//
getPrices.onLoad=function(){
	trace(this.thePrices);
	
	
}

XML FILE:
<?xml version="1.0" encoding="ISO-8859-1"?>
<priceList>
	<part id="001-A">CD Player</part>
	<price>320</price>
	<part id="002-A">Shocks</part>
	<price>450</price>
	<part id="003-A">Car Cover</part>
	<price>500</price>
</priceList>





Return True,




CK
Principal/Designer/Programmer -Bushidodeep
www.bushidodeep.com
___________________________
"An ideal is merely the projection,
on an enormously enlarged scale,
of some aspect of personality."
                                         ---------- Aldus Huxley

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux