A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Passing variable from php4 to flashMX

  1. #1
    Senior Member
    Join Date
    Aug 2001
    Posts
    114

    Passing variable from php4 to flashMX

    What script to I need to pass a variable set in a PHP4 file to MX.

    PHP Line is...
    $flashText = "a string";

    MX line is...
    ????


  2. #2
    Member
    Join Date
    Jul 2001
    Posts
    91
    try this:
    php:
    PHP Code:
    $flashText "&flashtext=a string";
    echo 
    $flashtext;

    then you can access it as a variable like this:

    var 
    loader = new LoadVars();
    loader.onLoad = function(done) {
        if (
    done) {
            
    trace(this.flashtext);
        }
    };
    loader.load(somefile.php); 

  3. #3
    Senior Member
    Join Date
    Aug 2001
    Posts
    114
    Thanks spacether,

    More specificly I am trying to pull the variable off of a URL string.

    http://www.whatever.net/Select.PHP?T...5393924&ENum=1

    I am trying to use the Text variable.

    I tryed this, with no success...
    loadVariablesNum("http://www.whatever.net/dbText/"+Text+".txt", 0);

    am I way off?


  4. #4
    Member
    Join Date
    Jan 2004
    Location
    USA
    Posts
    42

    hmmmm

    Their are two methods: The method you want is get but post is much better:

    Loadvars-As the guys descibed above is the post mehtod it is the one id recommend but i dont know what your tryin to do

    Get-look in flash for GetURL (atleast I think thats the command).....ohm let me think a while get URL should get you started though; that will pull the information off of a URL encoded string

    You may be delving into a more advanced topic....but I still dont see why you dont just directly access the information behind the scenes, descirbe your problem more in depth i need some background on the problem.
    I will own you, with ease, have a nice day.

  5. #5
    Senior Member
    Join Date
    Aug 2001
    Posts
    114
    Blood_God,

    The user fills out a form then the PHP file emails another person with the information the user filled out. Sort of like those greeting cards you see.

    The info from the form is being stored in a txt file that is randomly named by the php file. Therefore I can not hard code the URL in the flash file because it changes for each form that is filled out.

    The URL I put down, in my pervious message got changes some how. the last part should be..

    Select.PHP?Text=75393924&ENum=1

    Text is the name of the txt file on the server.

    Basicly all I need to do is have my .swf read the Text variable. For some reason I can't get it done.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center