PDA

View Full Version : action script error


corbo950
07-04-2008, 01:35 AM
The data service returns the number of users that have updated if none have updated i want to run the import other wise i want to check and see of the administrator wants to export the updates but something is wrong in my if statement because it runs what is in the if and what is in the else

public function updateResult(event:ResultEvent):void {
var Result:int = int(event.result.toString());
if(Result>0)
{
var messange:String = Result + " users have updated their information since you last exported a family list. " +
"Would you like to export?";
Alert.show(messange, "Export", 3, this, updateClickHandler);
}
else
{
mysqlImport();
}
}

mattb
07-08-2008, 03:50 AM
The code appears to be fine, but without a full application it's impossible to test.

There's no logical way that your code can run both the if and else blocks, so check to see if the function is being called twice with differenty results each time - add a trace at the beginning of the function to check.

corbo950
07-08-2008, 07:03 AM
but i see the pop up like i should and the error shows up but then if i comment out the mysql import function then the error goes away

mattb
07-08-2008, 02:08 PM
As I said, check to see if that function is being called twice.