dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Passing PHP vars into an MC

  1. #1
    eveningtidemusic.com tristankelley's Avatar
    Join Date
    Jul 2003
    Posts
    377

    Passing PHP vars into an MC

    Hi all,
    I am having trouble passing a PHP variable into an MC in my flash movie. When i have my contact form on the root all variables are passed perfectly but when I load the contact form into an MC the variables from the PHP file are not passed into flash. I tried adding _root.mcname in front of a couple things in the PHP file but this did not work. The section of code I am having trouble w/is below. Thanks.

    PHP Code:
    //Confirmation is sent back to the Flash form that the process is complete
    $sendresult "Thanks $yourname for refering a friend! You and your friend will receive a confirmation email shortly.";
    $send_answer "answer=";
    $send_answer .= rawurlencode($sendresult);
    echo 
    "$send_answer";

    endif;

    ?> 

  2. #2
    Junior Member
    Join Date
    Feb 2004
    Location
    Canada
    Posts
    4
    i have the same problem i just gave up and kept mine on the root but after u load them in u can change them to _global.yourvariable in flash so that if u wanna use them somewhere else u can make sure u put _global. everywhere u wanna use it too

  3. #3
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    If your form is in the main timeline of a externally loaded swf you can use....

    this.loadVariables("pathToScript","POST");

    That will get the variables from the php to the same timeline the code is on.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  4. #4
    eveningtidemusic.com tristankelley's Avatar
    Join Date
    Jul 2003
    Posts
    377
    what i currently have is...

    loadVariablesNum (mailform, 0, "POST");

    the contact form is located inside an MC of an externally loaded swf.

    I tried your way and I tried this...

    _root.loadMC.formMC.loadVariablesNum (mailform, 0, "POST");

    but it didn't produce anything at all.

  5. #5
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    As mailform probably is the name of the mc it should have quotes around it as its not a variable. ( or is it a varioable with the path?)

    A absloulte path would be.. ( if mailform is a path )

    _root.loadMC.formMC.loadVariablesNum (mailform, "POST");

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

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