Board Logo

Hints object-orientation
Coolbru - 7/2/2003 at 11:37 AM

I've been playing with hints, and have had a great deal of trouble getting it to work, largely because much of the documentation does not agree with the sample code.
The biggest problem was simply the naming of the hints script instance variable. The documentation variously refers to it as myHints, myHint, Hints, myTip and myTips. It should not matter what it's called - we instantiate an instance in our cfg script, then send it events using the same name.
Unfortunately that's not the case; it turns out that the hints.js script has hardcoded references to "myHint", and the script will not work unless you also use that name. What's going on? Surely you can refer to "this" to avoid any such explicit references? Are you saying that Javascript can't introspect to the extent that an object cannot find out its own name? How do you propose that you deal with multiple instances of the hints script? it just won't work as it stands!
Other than that, I've found the Tigra scripts pretty good, though I'll repeat my request that you ensure that your demo pages all pass W3C validation.

Back to forum: