Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6584115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:29:49+00:00 2026-05-25T16:29:49+00:00

I’m trying to use the if statement in flash to check if a variable

  • 0

I’m trying to use the if statement in flash to check if a variable (fetched from PHP) is equal to something, but something is going wrong.

The code:

function completeHandler(event:Event):void{
    // Load the response from the PHP file
    var data:URLVariables = new URLVariables(event.target.data);
    var return_stat = data.return_stat_verify;



    if (return_stat == "FAILED"){
    status_txt.text = "dsfdsfg";
        }
        else if (return_stat == "PASSED"){

        var first_nme = data.return_first;
        var second_nme = data.return_second;
    var email_addr = data.return_email;
    var user_domain = data.return_domain;
    var user_name = data.return_username;

    gotoAndPlay("finish");

    first_txt.text = first_nme;
    second_txt.text = second_nme;
    email_txt.text =  email_addr;
    username_txt.text = user_name;
    domain_txt.text = user_domain;


    }

Now when i test that, nothing happens. I then make an attempt to place a simple else statement in there to see if both if and else if statements fail.

the code:

function completeHandler(event:Event):void{
    // Load the response from the PHP file
    var data:URLVariables = new URLVariables(event.target.data);
    var return_stat = data.return_stat_verify;

    if (return_stat == "FAILED"){
    status_txt.text = "dsfdsfg";
    }
    else if (return_stat == "PASSED"){

    var first_nme = data.return_first;
    var second_nme = data.return_second;
    var email_addr = data.return_email;
    var user_domain = data.return_domain;
    var user_name = data.return_username;

    gotoAndPlay("finish");

    first_txt.text = first_nme;
    second_txt.text = second_nme;
    email_txt.text =  email_addr;
    username_txt.text = user_name;
    domain_txt.text = user_domain;


    }
    else {
        status_txt.text = "I hate flash";

    }

Now when i test that, flash prints out “I hate flash” in the status_txt field. So i then replace the value of status_txt to print out the variable that I’m using the if statements with (return_stat):

else {
            status_txt.text = return_stat;

        }

Then when i test it, it shows either PASSED or FAILED. Which means the issue does not lie in PHP as it’s returning the correct data and the issue lies within the If statements.

I’m completely lost here. I don’t see anything that I’ve done wrong, any ideas?

Thanks guys.

EDIT

My PHP CODE:

<?php

require ('installation_5_functions.php');
require ('cust_ver_i.php');


$username=$_POST['userName'];

$ident_encrypt=$_POST['userPsswrd'];


verify($reference_id, $username, $ident_encrypt);


if ($ref_id_stat == "FAILED"){

$retrn_stat = "FAILED";

print "return_value=$error_ref_id&return_stat_verify=$retrn_stat";  

exit();

}
if($ref_id_stat == "PASSED"){

if ($user_verify_status == "FAILED"){

$retrn_stat = "FAILED";


print "return_value=$user_verify_error&return_stat_verify=$retrn_stat";

}

elseif ($user_verify_status == "PASSED"){

if ($cust_status == "DEACT"){

$retrn_stat = "FAILED";

print "return_value=$display_error_stat&return_stat_verify=$retrn_stat";    

}
elseif ($cust_status == "ACTIVE"){

$retrn_stat = "PASSED"; 

print "return_first=$cust_first&return_second=$cust_last&return_email=$cust_email&return_username=$cust_username&return_domain=$cust_domain&return_stat_verify=$retrn_stat";

}

}
}



?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:29:49+00:00Added an answer on May 25, 2026 at 4:29 pm

    A lot of times there can be issues with whitespace. For example, if

    data.return_stat_verify == 'FAILED  '
    

    When you put it into a TextField, there will not appear to be a difference. To see if this is the case, you might try:

    // place a character on both sides. That will show whether there is whitespace
    status_txt.text = "|"+return_stat+"|";
    

    EDIT

    It looks like this is the case below. This means you need to trim your input. First, make sure that there is no extra whitespace in the PHP file (do you have the last line as ?> or is there an empty line at the end? An empty line, outside of ?> would cause the problem you describe.

    Then, for safety’s sake, check the input as well. Personally, I would use StringUtil.trim because it is the most explicit and because most languages have some way to do something very similar. Failing that, I would use regex to fix this:

    // using two to be explicit
    // /^\s+/m this removes all occurrences of one or more spaces at the beginning
    return_stat = return_stat.replace(/^\s+/m, "");
    // /\s+$/m this removes all occurrences of one or more spaces at the end
    return_stat = return_stat.replace(/\s+$/m, "");
    

    Of course, you could just in-line it:

    // use the global flag if you are doing this all at once.
    return_stat = return_stat.replace(/^\s+|\s+$/mg, "");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
I want to count how many characters a certain string has in PHP, but
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.