Hi,
I hope someone can help me with this. I try to make a start
using PHP in Flash.
I have a basic problem using PHP and MySQL in Flash doing
this the first time.
I want to show the text of just one record in Flash.
The database is on my testing computer.
The PHP code I use I borrowed from something else I created
with Dreamweaver.
When I test the PHP code in Safari it shows the text I
expect. With or without urlencode.
The Flash path to the PHP document code is probably correct.
However when I test the movie it displays: undefined.
Any help will be much appreciated.
Jos
Here is the code:
PHP
<?php
$hostname_cnNormaal = "localhost";
$database_cnNormaal = "portfoliosite";
$username_cnNormaal = "portfolioadmin";
$password_cnNormaal = "waddeneiland";
$cnNormaal = mysql_pconnect($hostname_cnNormaal,
$username_cnNormaal, $password_cnNormaal);
?>
<?php
mysql_select_db($database_cnNormaal, $cnNormaal);
$query_rsHome = "SELECT kp, tekst, beeld FROM kortetekst
WHERE id = 2";
$rsHome = mysql_query($query_rsHome, $cnNormaal) or
die(mysql_error());
$row_rsHome = mysql_fetch_assoc($rsHome);
?>
<?php $dezeTekst = $row_rsHome['tekst'];
echo $dezeTekst;
?>
Actionscript
var txtDisplay:TextFormat = new TextFormat();
txtDisplay.font = "Arial,Helvetica,_sansserif";
dataBase_txt.setNewTextFormat(txtDisplay);
dataBase_txt.autoSize = "left";
var getJosText:LoadVars = new LoadVars();
getJosText.load("
http://localhost/phpflash/naarFlashTest.php");
getJosText.onLoad = function() {
dataBase_txt.text = this[$dezeTekst];
};