Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flash communicating via XML with PHP

Status
Not open for further replies.

SFiend

Programmer
Jun 4, 2004
39
CZ
Hello,

does anyone have an example of a flash that communicates with PHP via XML?

Thanks
 
do you want the php file to format output as xml for flash to parse

or are you trying to send xml formatted data from flash to a php page

 
I use LoadVars now. This code:

FLASH:
Code:
odeslane.idBaneru = idBaneru;
prijate.onLoad = function () {
	popisek.text = this.popisek;
//	glowFiltr.alpha = 0.75;
//	glowFiltr.blurX = 3;
//	glowFiltr.blurY = 3;
//	glowFiltr.color = 0x000000;
	popisek.filters = [glowFiltr];
	nadpis.text = this.nadpis;
	vnitrek.cacheAsBitmap = true;
	odchoziUrl = this.odchoziUrl;
	urlObrazek1 = this.urlObrazek1;
	urlObrazek2 = this.urlObrazek2;
	urlObrazek3 = this.urlObrazek3;
	urlObrazek4 = this.urlObrazek4;
	urlObrazek5 = this.urlObrazek5;
	nahravac.loadClip(urlObrazek1, obrazek1);
}
odeslane.sendAndLoad(ZAKLADNI_URL + "baner.php", prijate, "POST");

PHP:
Code:
<?php
	require_once('konfigurace.inc.php');
	require_once('pamet.inc.php');
	$Pamet = new Pamet(RUKOJET, VELIKOST);
	require_once('banery.inc.php');
  $Banery = new Banery($Pamet->Cti(PAMET_BANERY));

	if (isset($_POST['idBaneru']))
		$Baner = $Banery->Cti($_POST['idBaneru']);

	header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
	header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
	header("Cache-Control: no-store, no-cache, must-revalidate");
	header("Cache-Control: post-check=0, pre-check=0", false);
	header("Pragma: no-cache");

	$Vystup = array(
		'urlObrazek1' => URL.CAST_URL_OBRAZKY.$Baner['Obrazky'][0],
		'urlObrazek2' => URL.CAST_URL_OBRAZKY.$Baner['Obrazky'][1],
		'urlObrazek3' => URL.CAST_URL_OBRAZKY.$Baner['Obrazky'][2],
		'urlObrazek4' => URL.CAST_URL_OBRAZKY.$Baner['Obrazky'][3],
		'urlObrazek5' => URL.CAST_URL_OBRAZKY.$Baner['Obrazky'][4],
		'nadpis' => $Baner['Nadpis'],
		'popisek' => $Baner['Text'],
		'odchoziUrl' => $Baner['Url']
	);
	
	print(http_build_query($Vystup));
?>

and I want to change it and use XML. Array $Baner['Obrazky'] is variable and I need it variable in the FLASH as well. I think that the communication via XML will be better.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top