Gadget works first time, corrupted on reload.
Monday, September 4, 2006 by Skarny | Discussion: DesktopX
I am having a problem with loading the gadget.
After export it works fine, then after closing it, and then reloading it, mouse over states (no image displayed for an object) and various scripts etc just dont seem to be there.
Closing and reopening the problem remains.
Repackaging the gadget maks it works ONCE again.
There are no persistent variables and I have tried using persist and no persist object states option while making the gadget.
Any ideas?
Reply #2 Sunday, September 10, 2006 6:55 PM
If I closed, waited a few more seconds, then reopened, there was no problems.
Thanks for your suggestions.
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!







Reply #1 Tuesday, September 5, 2006 1:10 AM
Do you mean by "no persistent variables" that you are using neither Object.LocalStorage, Object.PersistStorage, nor Widget.Preferences? I know LocalStorage just doesn't take with gadgets, never tried PersistStorage. The Widget.Preferences can also be corrupted in memory and even in the preferences.xml file if you create, check and adjust multiple Widget.Preferences in a single subroutine.
But, if you aren't using those, then that's no help.
Another thing I have experienced from time to time is a conflict in loading where certain scripts reference other scripts, which haven't yet loaded themselves. The funny thing is that these conflicts often aren't apparent as one works on their project. It is only when the widget or dxpack is imported that the issue arises. Also sometimes a widget will alert of "not enabled" scripts on execution also, if this is the problem. Try exporting as a widget or dxpack, then create a new, empty desktop, and then load the exported package as the end user might (double click or import). If any alerts pop up about referencing scripts not yet enabled, then this is happening when the gadget is run, but the gadget is not equipped to show those alerts.
I have found that I can usually resolve these script reference conflicts by streamlining my code or finding another way for scripts to know or do what it is that was causing the problem.
If you delete the Gadget cache between executions, does the gadget work on reload?
So, just some suggestions. I can tell you that I have experienced this very thing; mouse-over states losing their settings (including image apparently) and things simply not responding (after having worked swimmingly the first time). Sometimes I give up on exporting as a gadget, other times I rework it until it doesn't do it anymore (for whatever unknown reason). I love DX, but debugging Gadgets is no fun.
Good luck, let us know if you find a solution, please!