I think the problem is that when the book was written, thisProperty was implied when referring to attributes of the property housing the expression. Somewhere along the line it was changed so that now you have to explicitly include it. This should work:
effect("4-Color Gradient").param(thisProperty.propertyIndex - 2).valueAtTime(time - .5)
Dan, right on, thank you for the quick response. It works like a charm. I wonder how many more things like that have changed in the last 2-3 years (the book seems to be from 2008-9) Any reccomendations as to a more up-to-date book on the subject?
thanks a mil
Off the top of my head, the only other thing I can think of that has changed that would cause old expressions to break in newer versions of AE is that at some point (I forget which version) the hack to read a text file using #include stop working and now requires $.eval() instead.
As far as I know, Marcus's book is the only one dedicated to expressions. I don't know if he's planning an update.