From php to flash

For example i have this php code to check if the username is already in the mysql database

if(usernameTaken($usernameFromFlash )){

// how to pass an error message to flash?

   }
   else{
addNewUser($usernameFromFlash, $passwordFromFlash);
}

as you can see if the statement is true, it does nothing. I can’t for the life of me figure out how to pass an error message to flash.

If it helps, here’s my as3 code.

import flash.events.*;
import flash.net.URLLoader;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequest;
stop();

var variables:URLVariables = new URLVariables();
var varSend:URLRequest = new URLRequest("register.php");
var varLoader:URLLoader = new URLLoader;
varSend.method = URLRequestMethod.POST;
varSend.data = variables;

bt_sub.buttonMode = true;
bt_sub.addEventListener(MouseEvent.CLICK, ValidateAndSend);


function ValidateAndSend(event:MouseEvent):void

{
	
	
	 variables.user = user_txt.text;
	 variables.pass = pass_txt.text;

   		varLoader.load(varSend);
	
}