Let me guess: You're trying this in Flash. Right?
HostObject is only valid for the apps with the CSAW libs.
No, im trying this with Photoshop Cs5
Ok i made an speling error! It works now! Im sorry!
Oh well. Bad guess...
Are you using Extension Builder?
Did you ever resolve this issues? I've run into the same problem. Running my panel in Photoshop works fine, but when debugging in Flash Builder it gives me that error (While running. It doesn't catch it before then). I'd like to be able to debug in Flash Builder without hanging up on this. Did you find a way around it?
Unless I am wrong, you cannot debug in Flex once you loaded csaw libraries. I mean, Flex will catch most mxml/as errors but it won't be able to deal with the part interacting with cs apps. At this level, only ExtensionBuilder can.
To be clear and given the fact you correctly imported the right classes and all needed stuff, this won't work in FB:
trace (app.activeDocument.name) or whatever cs dom command.
Hope it helps,
For what it worth, I created a jsinterface call to alert() so I use it as a trace replacement tool. Once again ExtensionBuilder is far more usefool in this workflow.