2 semi-random? problems

Hi Clifton,
I have two problems I can't seem to solve.
1) Rarely occurs but sometimes does. I get this message:

which is a serious problem because all execution ceases thereafter. I know it's to do with pgGotoURL. I found this out as I mentioned here https://www.pgsoftwaretools.com/forum/viewtopic.php?f=10&t=362 and wrote in my January 7th post: loading the two documents one after the other, using pgGotoURL, produces an error because the first document is not properly loaded before the second one arrives. but I can't see why the error occurs apparently randomly in other parts of the program. I use two two different fields ("screen1" and "screen2" to display the different parts of my program. There are a lot of these and generally each one is from a different exported tbk file. When I go from one part to another I use these scripts:
switchScreens is triggered by the destination page when it has finished loading.
2) When the page has loaded I sometimes get a wait cursor that refuses to go away until the user moves the mouse which is strange because the object that initiates the cursor change, a transparent field, is hidden as soon as the loading has finished. This usually happens after a video has been loaded but it doesn't always happen even when the same video is loaded. I guess it's not that serious but it is annoying. Apparently, from what I have read on Stack Overflow, this problem is not uncommon but I have't been able to use any of the suggestions I found.
Please let me know your thoughts. Thanks for your time.
John
I have two problems I can't seem to solve.
1) Rarely occurs but sometimes does. I get this message:

which is a serious problem because all execution ceases thereafter. I know it's to do with pgGotoURL. I found this out as I mentioned here https://www.pgsoftwaretools.com/forum/viewtopic.php?f=10&t=362 and wrote in my January 7th post: loading the two documents one after the other, using pgGotoURL, produces an error because the first document is not properly loaded before the second one arrives. but I can't see why the error occurs apparently randomly in other parts of the program. I use two two different fields ("screen1" and "screen2" to display the different parts of my program. There are a lot of these and generally each one is from a different exported tbk file. When I go from one part to another I use these scripts:
- Code: Select all
<function name="transition" event="" params="dest">
<![CDATA[
if (this.screenNo == 0)
{
tbfunction_changeObjectLayer("instructions_5", top);
tbfunction_snapObjectToCenter("pleaseWait", "screen0", 2);
tbfunction_pgTBObjSet("pleaseWait", "top", 680);
tbfunction_pgTBObjSet("pleaseWait", "visible", true);
this.screenName = "screen1"
tbfunction_pgTBObjSet("gif", "visible", true);
}
else if (this.screenNo == 1)
{
this.screenName = "screen2"
}
else if (this.screenNo == 2)
{
this.screenName = "screen1"
}
if (dest == "ss" || dest == "ts")
{
this.bColor = "191,255,255"
}
else if (dest == "vs" || dest == "vt1" || dest == "vt2")
{
this.bColor = "63,191,254";
}
else if (dest == "is" || dest == "it")
{
this.bColor = "192,220,192";
}
else if (dest == "as" || dest == "at1" || dest == "at2")
{
this.bColor = "253,253,189";
}
else if (dest == "tc")
{
this.bColor = "64,128,255"
}
tbfunction_pgGotoURL(this.screenName, "/programs/" + dest + "/index.html");
]]>
</function>
<function name="switchScreens" event="" params="">
<![CDATA[
if (this.screenNo == 0)
{
this.screenNo = 1;
tbfunction_pgTBObjSet("speech", "visible", false);
tbfunction_pgTimer("", "", "speech", true);
tbfunction_fadeObject("screen0", "", "", 2500, 0);
tbfunction_fadeObject("screen1", 2500, 100);
tbfunction_pgTBObjSet("gif", "visible", false);
var fct = function()
{
document.body.style.background = 'rgb(' + keys.bColor + ')';
tbfunction_pgStyleObject("fondo", "backgroundColor", "rgb(" + keys.bColor + ")");
tbfunction_pgTBObjSet("pleaseWait", "visible", false);
}
setTimeout(fct, 1250);
}
else if (this.screenNo == 1)
{
this.screenNo = 2;
tbfunction_fadeObject("screen1", "", "", 2500, 0);
tbfunction_fadeObject("screen2", 2500, 100);
var fct = function()
{
document.body.style.background = 'rgb(' + keys.bColor + ')';
tbfunction_pgStyleObject("fondo", "backgroundColor", "rgb(" + keys.bColor + ")");
}
setTimeout(fct, 1250);
}
else if (this.screenNo == 2)
{
this.screenNo = 1;
tbfunction_fadeObject("screen2", "", "", 2500, 0);
tbfunction_fadeObject("screen1", 2500, 100);
var fct = function()
{
document.body.style.background = 'rgb(' + keys.bColor + ')';
tbfunction_pgStyleObject("fondo", "backgroundColor", "rgb(" + keys.bColor + ")");
}
setTimeout(fct, 1250);
}
]]>
</function>
switchScreens is triggered by the destination page when it has finished loading.
2) When the page has loaded I sometimes get a wait cursor that refuses to go away until the user moves the mouse which is strange because the object that initiates the cursor change, a transparent field, is hidden as soon as the loading has finished. This usually happens after a video has been loaded but it doesn't always happen even when the same video is loaded. I guess it's not that serious but it is annoying. Apparently, from what I have read on Stack Overflow, this problem is not uncommon but I have't been able to use any of the suggestions I found.
Please let me know your thoughts. Thanks for your time.
John