Skip to main content
Participating Frequently
October 19, 2009
Question

questions about LoadVars in fms3.5, can not access website php data

  • October 19, 2009
  • 1 reply
  • 1797 views

hello,everyone, I install a fms3.5(free version) in  my pc.   I create an application,in the main.asc, code like this:

application.onConnect = function(p_client)
{
  
this.acceptConnection(p_client);
trace("onConnect");

var send_lv = new LoadVars();
 
send_lv.kwtype ="1";
send_lv.searchtype="titlekeyword";
send_lv.keyword="sz";

 
var s=send_lv.send("http://www.s1979.com/plus/search.php", "_blank", "POST");
trace("send:"+s);


}

run the flash app,connect the fms,then in the fms log panel is: 

   onConnect

   send:false

it seems that LoadVars.send() does not work.it  can not access the php. and the web-browser didnot open webpage window.

I did not make any config change in the default fms.ini, should I make any config in the fms.ini? 

the fms do not allow application to asscee outside data?

In this application, I  create a new folder in the {FMS-Install-Dir}/applications
  folder, with a  main.asc inside. I do not place an Application.xml in this folder.

    This topic has been closed for replies.

    1 reply

    October 19, 2009

    Loadvars on the server side is different than loadvars on the client side. FMS does not open a browser window. On the server side, the "target" flag is a file object, but you're not using a file object. I suspect that's why the call is failing... you have no file object named _blank.

    See the FMS docs for proper usage of LoadVars.load and LoadVars.sendAndLoad

    http://help.adobe.com/en_US/FlashMediaServer/3.5_SS_ASD/WS5b3ccc516d4fbf351e63e3d11a11afc95e-7ff7.html

    szuojqAuthor
    Participating Frequently
    October 20, 2009

    Thank u very much. It works, just like what you said, the reason is " I  have no file object named _blank." .

    Now is another question, I test this code in the main.asc

    application.onConnect = function(p_client)
    {
        trace("onConnect");
        this.acceptConnection(p_client);

        var my_lv = new LoadVars();
        my_lv.onLoad = function(success) {
            if (success) {
                trace(this.toString());
            } else {
                trace("Error loading/parsing LoadVars.");
            }
        };
        var t=my_lv.load("http://www.helpexamples.com/flash/params.txt");
    trace("t="+t);
    }

    when I run the flash, when connect the fms, in the log trace , like:

    onConnect
    t=true
    Error loading/parsing LoadVars.

    ==========

    It seems that it cannot load the data successfully.

    October 20, 2009

    What does the output of the php program look like when you load it in a browser? The result indicates that either the URL is not valid, or the result is not useable by LoadVars