Actually i was able to make it work.
i dont knkw why yet but appearently its working great when im doing it on my CS6 version.
so the problem is not with the expression.
but there is another thing i wish to understand.
in the book he stated that for this expressions
my text need to have this variable
var myText = "";
but i still need to know why?