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

Audio Recorder for Adobe Flash

This is a fully customizable Audio Recorder for Adobe Flash, built with support for exporting MP3 files. Your user will be able to record with ease, because everything you need is in the component (no need for a streaming server).

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