3pepe3
08-03-2007, 03:28 AM
Hello world.
This question I don’t know if must be in actionscript2 or server side-scripting. But I feel that this is the correct section.
The problem is: I have a main.swf that loads askphp.swf and this askphp sendandload answer.php.
Folder structure:
page/ (folder)
main.html
main.swf
swfs/ (folder)
otherfolder/
askphp.swf
phps/ (folder)
answer.php
but I can’t find the way to get answer… in a textfield I’m getting "Error connecting to server."
askphp.fla
//simplified version
var answer_lv:LoadVars = new LoadVars();
answer_lv.onLoad = function(success:Boolean) {
if (success) {
t.text = answer_lv.info ;
} else {
t.text = "Error connecting to server.";
}
};
var send_lv:LoadVars = new LoadVars();
send_lv.sendAndLoad("phps/answer.php",answer_lv,"POST");
The answer.php:
<?php
//simplified version
echo "&info=hello world&";
?>
What I think is that the problem is referencing to the php file.
send_lv.sendAndLoad("phps/answer.php",answer_lv,"POST");
//but I think that main.swf is the root so the php file is phps/answer.php
//also another option was that php must be relative to the askphp.swf so I changed the path to:
//send_lv.sendAndLoad("../../phps/answer.php",answer_lv,"POST");// but this method was just working outside the main.swf
Any advice???
This question I don’t know if must be in actionscript2 or server side-scripting. But I feel that this is the correct section.
The problem is: I have a main.swf that loads askphp.swf and this askphp sendandload answer.php.
Folder structure:
page/ (folder)
main.html
main.swf
swfs/ (folder)
otherfolder/
askphp.swf
phps/ (folder)
answer.php
but I can’t find the way to get answer… in a textfield I’m getting "Error connecting to server."
askphp.fla
//simplified version
var answer_lv:LoadVars = new LoadVars();
answer_lv.onLoad = function(success:Boolean) {
if (success) {
t.text = answer_lv.info ;
} else {
t.text = "Error connecting to server.";
}
};
var send_lv:LoadVars = new LoadVars();
send_lv.sendAndLoad("phps/answer.php",answer_lv,"POST");
The answer.php:
<?php
//simplified version
echo "&info=hello world&";
?>
What I think is that the problem is referencing to the php file.
send_lv.sendAndLoad("phps/answer.php",answer_lv,"POST");
//but I think that main.swf is the root so the php file is phps/answer.php
//also another option was that php must be relative to the askphp.swf so I changed the path to:
//send_lv.sendAndLoad("../../phps/answer.php",answer_lv,"POST");// but this method was just working outside the main.swf
Any advice???