A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Urgent HELP!!! Flash and CGI/PHP

  1. #1
    Junior Member
    Join Date
    Apr 2000
    Posts
    28

    Post

    I only have until friday (may 5th) to have the framework for this up and running, so as you can imagine, I'm sweating it. How do I get CGI (or PHP, it doesn't matter) to write flash variables to a text file? The CGI script that I wrote doesn't work and I'm stuck. Also, is there a way to run a CGI script in flash without having the browser go to another page? Any help would be GREATLY appreciated!
    Thanks,
    Jaime

  2. #2
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756

    Post

    Toony, you have to write the variables in the following format ( in .txt file ):
    var=value
    in Perl use
    $variable='var='.value;
    write it to a file.
    use LoadVariables in Flash
    create a variable name=eval( "var")
    create a txtfield named name.
    This is verry basic as you see hope it helps
    Mad-Sci

  3. #3
    Junior Member
    Join Date
    Apr 2000
    Posts
    28

    Talking

    Thanks so much! You are a lifesaver (and a genius.) One question though. What is the appropriate code to have perl write to a file? I have been using:

    open(FILE, ">variable.txt");
    print FILE $buffer;
    close(FILE);

    But, I'm new to perl, and I am unsure if its correct.
    Thanks again for the help.
    "Toony"

  4. #4
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756

    Post

    Toony, the question is do want to append to file or not. If you want to append use:
    open(FILE, ">>variable.txt");
    print FILE $buffer;
    close(FILE);
    but you have to have a counter to create an array something like:
    $Flash_var='name'.$counter.'='.$value.'&';
    so you get:
    name1=value&name2=value$....
    call input_name=eval("name"$count);
    see what i mean.
    Mad-Sci


  5. #5
    Junior Member
    Join Date
    Apr 2000
    Posts
    28

    Talking

    I really didn't want to append the file, just overwrite what was already there. All I am doing is saving certain user info into a text file. Thanks for your help!

    Jaime

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