PDA

View Full Version : urgent...newbie wants to pass data to movieclip


monimaroni
01-19-2003, 11:19 PM
hi everybody,
i urgently need some help with my actionscript...well, to make it short, i can't figure out how to pass data (generated by a php-script) to my flash-file...

i've got 2 input textfields with the variables Ndec1 and Edec1. these variables should be passed to a php-script which calls the mysql-database and returns the id for this pair of variables. the php seems to work - at least it does by using a html-form for Ndec1 and Edec1.

when pushing a button, the php-script is called by

loadVariables("http://mydomain/search.php", _root.loader);

_root.loader is a movie clip where the data should be loaded into. and now - how can i get the data into a dynamic textfield??

the variable passed by php is named $pos1, my dynamic textfield on stage is called pos1 as well...the actionscript attached to the loader-movie is:

onClipEvent (data) {
_root.success = "data has been loaded"; //this works fine
_root.pos1 = _root.loader;
}
thanks a lot for your help - and please excuse my english...moni

CyanBlue
01-20-2003, 12:38 PM
Howdy... :)

If you are using Flash MX, why not use LoadVars() object's sendAndLoad() function to send and get the data back from the PHP script??? I think it will be whole lot easier for you to deal with...
Something similar to this might work for you...tempLVs = new LoadVars();
tempLVs.sendAndLoad("http://mydomain/search.php", _root.loader);
tempLVs.onLoad = function(success)
{
if (success)
{
_root.success = "data has been loaded"; //this works fine
_root.pos1 = this.pos1; // this meaning the tempLVs object which gets the data from your PHP script
}
}