Maybe there is a typo in the documentation. It should read:
var u:URLRequest = ....
without the "public" scope. Since you are defining the
variable within the function, it has local scope. Keywords, public,
private, and protected refer to the access permissions on functions
and variables at the class level. For example, the executeSearch
function is publically available.