This content has been marked as final. Show 7 replies
what's not working?
what code do you use to define infoVars? do you have an onLoad or onData handler for infoVars? are you having a problem with asynchronous transmission (because sendAndLoad() is asynchronous)?
what's not working is when i put the sendAndLoad function in my "onpress" event of my button
But if i put it outside of the code's button, then it's working...
My variable infoVars is a onLoad that define in the root of my fla like this :
infoVars = new LoadVars();
Shoud i use a onData object ??
Because actually , that i want to do is to get information from my database (mysql) when you push a button , to load this information in a dynamic textfield ...
show the code on your button.
p.s. i already think you'll have a problem getting any information to appear in your textfield if you're using its text property (and not its variable) because what you showed is not an onLoad handler.
oh sorry , yes it's a LoadVars but anyway that's my code on my button :
_root.infoVars.sendAndLoad(_root.server_path+"infocourses.php", _root.infoVars, " POST ");
_root.infoVars.onLoad = function()
_root.cont.gotoAndStop("cours"); //cont is a movie clip
and this is the code of my frame "cours" where there is my dynamic textfield :
you have more than one problem.
first, if you want to test if _root.info_loaded is equal to 1, you need to use the double equal (==) in your if-statement.
second, you need to loop that if-statement in order to assign the htmlText property to your textfield.
third, you should define your onLoad handler BEFORE executing your sendAndLoad() statement.
and finally, you don't need any of the above if you use: