Pages: [1]
  Print  
Author Topic: A question of examples about loadvariables  (Read 3066 times)
0 Members and 1 Guest are viewing this topic.
nanifrankey
Newbie
*
Posts: 25


« on: 22 May , 2009, 06:27:17 »

I have a small question about the loadvariables(.... "/main", "POST")
if people download the examples, it is always with  "/main", "POST" in the end of loadvariables.
But if we look at the examples on page, for example.
loadVariables("http://127.0.0.1:1001/Basic/uldl?klCommand=loadVariables&
klUrl=http://www.example.com/page/get.php?variable%201=value&klUrlDecodeOff=1",
"" );

it is always end by "". if I use "" instead of "/main", "POST", the loadvariables doesn't work in the example. Can I ask why?
why there is this difference?
Logged
nanifrankey
Newbie
*
Posts: 25


« Reply #1 on: 26 May , 2009, 06:01:46 »

when I run it, it has error -28
I believe it is not caused by .main or post

loadVariables("http://127.0.0.1:1001/Basic/uldl?klCommand=loadVariables&klUrl=http:...test.php?&sendToPHP=hello&klUrlDecodeOff=1","/main","POST" );

why wrong?  I want to send variable $sendtoPHP to php
server side
<?php
if ($sendtoPHP == hello)
{echo "testme";}
>

how to trace this testme in flash lite 1.1?             
is it trace(testme);? because trace(this.testeme) is wrong
sorry it is stupid problem maybe, I just cannot find the solution now.
Logged
KL Admin
Moderator
Sr. Member
*****
Posts: 313


« Reply #2 on: 26 May , 2009, 10:42:48 »

Try this, it works :
loadVariables("http://127.0.0.1:1001/Basic/uldl?klCommand=loadVariables&klUrl=http:...test.php?%26sendToPHP=hello&klUrlDecodeOff=1","/main","POST" );


(If you look above, & in the URL is encoded into %26. Otherwise it will be translated as plug-in related variable, confusing plug-in..).

Best
Logged
nanifrankey
Newbie
*
Posts: 25


« Reply #3 on: 27 May , 2009, 02:14:22 »

Thank you KL Admin, but still need your help.  Tongue
I still have another problem of getting variables from PHP
do I need to write 
loadVariables("http://127.0.0.1:1001/Basic/uldl?klCommand=loadVariables&klUrl=http:../loadvariabletest.php","/main","GET");
 or just using
loadVariables("http://127.0.0.1:1001/Basic/uldl?klCommand=loadVariables&klUrl=http:../loadvariabletest.php?%26sendToPHP=hello&klUrlDecodeOff=1","/main","POST"); Both of them, I cannot trace any value from php.  ----------------------------- trace(superice);
Sorry, I am not quite familier with AS1.
the server-side code is as below;
<?php
if ($_POST["sendToPHP"] == "hello"){

 $message='The data values were '.
      'received from Flash successfully!';
   echo 'Sending to Flash ... ';
   echo "&testme=.$message";
   echo "&superice=superice";}
?>

I think, it should return value from php to flash, such as superice, or testme
but I can only see that klError is 0 when I call loadvariables(), I cannot trace any value, all of them are Null.
Why?
I also see there are many examples which introduced to use: loadvariables (http://...loadvariablestest, ""); but it doesn't work either.

Why? I just used as2,3 before, it is not supported by flashlite 1.1. It really tortures me!
 Could you give me some hint of it?
Logged
Pages: [1]
  Print  
 
Jump to: