PDA

View Full Version : flash to php and back


azadder
12-21-2005, 05:49 PM
I am using flash to get information from php (from a database). I am having problems getting the info FROM php back to flash.

Here's what I have (flash side):

on (click) {
var tophp = new LoadVars();
var fromphp = new LoadVars();

tophp.num = "85";

tophp.sendAndLoad("update.php", fromphp, "POST");
fromphp.onLoad = loadedphpvars;

function loadedphpvars(){

}
}


I know that the function is empty, there isn't anything that I want to put in it now.

I have a dynamic text instance that I want to hold the data that is coming back from php. I set the Var (of the dynamic text instance) to "phpname".

Here's the code I have for the php page:

<?php

include 'dbfunc.php';

$id = $_POST["num"];

$conid = connect_to_database();

$name = sel_fromid($conid,"name","ID",$id,0);

echo "&phpname=".$name;
?>


(The php custom functions are all correct/work)

The dynamic text instance isn't updating... Any suggestions/ideas?

leobar021
01-18-2006, 02:37 AM
hm I'm doing simillar thing write now ,what have you done so far ?!
Maybe problem is in depth ,did you try to use getNextHighestDepth

RysChwith
01-18-2006, 08:40 AM
Try explicitly changing the dynamic text:function loadedphpvars(){
instanceNameOfDynamicTextField.text = phpname;
// if the text field is HTML enabled, you have to use htmlText instead of text
}Despite every description to the contrary, I've never seen a dynamic text field automatically update without the entire frame reloading.

Rys