ActionScript-javascript communication


I am facing some problem with my as-js communication.I am passing a String expression to a javascript function using function upon mouse click.My string expression is as follows

Inside my js function i am just using eval(str).callAS(id) contains a call to actionscript function to retrive the value of x using id.I am able to make call to the actionscript by registering the function using ExternalInterface.addCallBack(“callActionScript”,ASFunction) but the transfer doesnt return to the js on return i.e the value of x is not getting populated with the retrieved value.My function in actionscript is like this
public function ASFunction(id:String):Number
return 6;

This 6 have to be returned to js thereby populating x=6;which is not happening.Any suggestions will be of great help