A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Passing Flash to PHP

  1. #1
    Junior Member
    Join Date
    Mar 2007
    Posts
    2

    Passing Flash to PHP

    I'm pretty new to Flash and am very, very frustrated. I've done one slide in Flash that passes variables from two radio buttons to PHP. I'm doing logic in the PHP file that then returns text back to that same slide based on how they respond to the two questions. That works perfectly fine. I've added a variable to the ActionScript (version 2 with Flash 8) that I simply want to pass to the PHP to determine which slide they're on. That variable keeps coming back to Flash as undefined, and I don't understand why. The code is below, and the variable I'm having problems with is 'tslide'.

    btnSubmit.onRelease = function()

    {
    NoSelect.visible=false;
    btnNext._visible=false;
    //trace (smokey.selected);
    if((smokey.selected==false && smoken.selected==false) || (drinky.selected==false && drinkn.selected==false) ) {
    NoSelect.visible=true;
    btnNext._visible=false;
    return;
    }else{
    NoSelect.visible=false;
    btnNext._visible=true;

    }

    var tslide:Number;
    tslide=1;
    //trace(tslide);
    lvOut.smoke = _global.smoke; //assign user-input value to lv property called smoke
    lvOut.drink = _global.drink; //assign user-input value to lv property called drink
    lvOut.tslide= _global.tslide.text;

    lvOut.sendAndLoad(path + "lesson1results.php", lvIn, "POST"); //get results returned to lvIn
    };
    stop();

  2. #2
    Senior Member
    Join Date
    May 2002
    Posts
    1,017
    _global.tslide.text - This cant be true. You can have global variables or global functions but haven't heard of global textfileds (unless you didn't assign the textfield to the global variable tslide) ... what is _global.tslide.text anyway? Also, it's generally not a good practice to have both global and local variables witht he same name - often it will lead to troubles and confusion.
    while (2+2 == 4) {
    drink ("bourbon");
    }
    gotoAndStop("bed");

  3. #3
    Junior Member
    Join Date
    Mar 2007
    Posts
    2

    Fixed

    Thanks for you reply. As I said, I'm very new to Flash. I posted this on another forum and somebody corrected my code so it works now.

    Thanks, again!

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