setting class with userProperty()

Hi Clifton,
I am having trouble using the userProperty function to set and unset the CSS style of certain fields. This seems to have occured since I have taken a lot of my code out of the tbk and put it in an XML file but I'm not sure.
I use it like this: tbfunction_userProperty([object name], "className", {class name], "set"); Often it just fails with no warning. The rest of the code is executed but the fields, which are white and transparent, stay the same. I have found that if I put an alert in the code just after the line that's not executed, the field style then appears. Reasoning that the system needs more time, I put in timeouts to break up the execution as you showed me.
This generally works but not always! It works better with longer values like 800 but even then it fails randomly.
I have also noticed that according to your notes it should be possible to reverse the class change by resetting it to "" This definitely does not work for me. I don't know whether this has anything to do with my other problems or not. I have put a test app here https://www.mediacours.com/tb_examples/testClass.zip the myGraphics folder should be added to the export tree. If you have no problems with it then it means my Toolbook 9.01 is the culprit.
Thanks for your time.
John
UPDATE my site is down for unknown reasons. I'll send you the zip via e-mail.
I am having trouble using the userProperty function to set and unset the CSS style of certain fields. This seems to have occured since I have taken a lot of my code out of the tbk and put it in an XML file but I'm not sure.
I use it like this: tbfunction_userProperty([object name], "className", {class name], "set"); Often it just fails with no warning. The rest of the code is executed but the fields, which are white and transparent, stay the same. I have found that if I put an alert in the code just after the line that's not executed, the field style then appears. Reasoning that the system needs more time, I put in timeouts to break up the execution as you showed me.
- Code: Select all
var fct = function () {...} setTimeout (fct, 500)
This generally works but not always! It works better with longer values like 800 but even then it fails randomly.
I have also noticed that according to your notes it should be possible to reverse the class change by resetting it to "" This definitely does not work for me. I don't know whether this has anything to do with my other problems or not. I have put a test app here https://www.mediacours.com/tb_examples/testClass.zip the myGraphics folder should be added to the export tree. If you have no problems with it then it means my Toolbook 9.01 is the culprit.
Thanks for your time.
John
UPDATE my site is down for unknown reasons. I'll send you the zip via e-mail.