LOGIN Don't have an account yet?   Register

Forgot password?
 

send and recive vars to and from php

  • avatar
    almatm
    on 13/4/10
    which method is better to send vars and recive them back from php?
  • avatar
    almatm
    on 13/4/10
    Here is the problem!!!

    var variables:URLVariables = new URLVariables();
    // Build the varSend variable
    // Be sure you place the proper location reference to your PHP config file here
    var varSend:URLRequest = new URLRequest("config_flash.php");
    varSend.method = URLRequestMethod.POST;
    varSend.data = variables;
    // Build the varLoader variable
    var varLoader:URLLoader = new URLLoader;
    varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    varLoader.addEventListener(Event.COMPLETE, completeHandler);

    variables.uname = uname_txt.text;
    variables.sendRequest = "parse";
    // Send the data to the php file
    varLoader.load(varSend);

    // When the data comes back from PHP we display it here
    function completeHandler(event:Event):void{

    var phpVar1 = event.target.data.var1;
    var phpVar2 = event.target.data.var2;

    result1_txt.text = phpVar1;
    result2_txt.text = phpVar2;

    }


    }


    flash says:
    TypeError: Error #2007: ???????? text ?? ?????? ???? ????? ????.
    at flash.text::TextField/set text()
    at MethodInfo-1()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()
  • avatar
    bobocel
    on 14/4/10
    Check our newsletter component, to see how we communicate with PHP from Flash.

    You can also try one of our free components if you like, which uses PHP to store the variables.

rss Subcribe to topic RSS

Post a comment

Please login to join the discussions. Don't have an account? Register (it takes 30 seconds)

This week's featured product

Store Locator

This cool AJAX application will enhance your website by showing your stores' locations. You can also display an image and a short description so your users know exactly where to find your business.

Become a premium member

premium membership Flabell and Themesbell membership provides users with the ability to download any of our components for Adobe Flash and website themes for free, during an entire year.
read more