Script error >Error:Script error. URL: L:0


#1

I an new to Hype. I have created a hype document that worked fine when viewed on Hype Reflect on an iPad. I have now added some Javascript to the document, and now, when I preview on the iPad only the black background loads and the console error is Script error >Error:Script error. URL: L:0

I have added nothing to the head.html. This is what I have added that has now somehow broken it…
On seven buttons on the front screen I have added an OnMouseClick action to run Javascript. This sets a variable for timing purposes. Each button sets a different variable that has a different Start Time value. For example, the first button has this set…
function SetTimingClassic (hypeDocument, element, event) {
window.layoutStartTime = 0.0333;
}

The next screen (which never appears as the document fails on the first screen load) has OnLayoutLoad set to action this Javascript
function LayoutTimeLoad(hypeDocument, element, event) {
hypeDocument.goToTimeInTimelineNamed(layoutStartTime, ‘Bun_Bottom’);
hypeDocument.goToTimeInTimelineNamed(layoutStartTime, ‘Bun_Top’);
hypeDocument.goToTimeInTimelineNamed(layoutStartTime, ‘Burger’);
hypeDocument.goToTimeInTimelineNamed(layoutStartTime, ‘Slider_Bun’);
hypeDocument.goToTimeInTimelineNamed(layoutStartTime, ‘Slider_Topping’);
hypeDocument.goToTimeInTimelineNamed(layoutStartTime, ‘Slider_Cheese’);
hypeDocument.goToTimeInTimelineNamed(layoutStartTime, ‘Slider_Burger’);
hypeDocument.goToTimeInTimelineNamed(layoutStartTime, ‘Slider_Salad’);
hypeDocument.goToTimeInTimelineNamed(layoutStartTime, ‘Slider_Relish’);
hypeDocument.goToTimeInTimelineNamed(layoutStartTime, ‘Relish’);
hypeDocument.goToTimeInTimelineNamed(layoutStartTime, ‘Salad’);
hypeDocument.goToTimeInTimelineNamed(layoutStartTime, ‘Cheese’);
hypeDocument.goToTimeInTimelineNamed(layoutStartTime, ‘Topping’);
hypeDocument.goToTimeInTimelineNamed(layoutStartTime, ‘Receipt - Bun’);
hypeDocument.goToTimeInTimelineNamed(layoutStartTime, ‘Receipt - Topping’);
hypeDocument.goToTimeInTimelineNamed(layoutStartTime, ‘Receipt - Cheese’);
hypeDocument.goToTimeInTimelineNamed(layoutStartTime, ‘Receipt - Burger’);
hypeDocument.goToTimeInTimelineNamed(layoutStartTime, ‘Receipt - Salad’);
hypeDocument.goToTimeInTimelineNamed(layoutStartTime, ‘Receipt - Relish’);
}

It also has On Layout Unload set to
function LayoutTimeUnLoad(hypeDocument, element, event) {
layoutStartTime = hypeDocument.currentTimeInTimelineNamed(‘Bun_Bottom’);
layoutStartTime = hypeDocument.currentTimeInTimelineNamed(‘Bun_Top’);
layoutStartTime = hypeDocument.currentTimeInTimelineNamed(‘Burger’);
layoutStartTime = hypeDocument.currentTimeInTimelineNamed(‘Slider_Bun’);
layoutStartTime = hypeDocument.currentTimeInTimelineNamed(‘Slider_Topping’);
layoutStartTime = hypeDocument.currentTimeInTimelineNamed(‘Slider_Cheese’);
layoutStartTime = hypeDocument.currentTimeInTimelineNamed(‘Slider_Burger’);
layoutStartTime = hypeDocument.currentTimeInTimelineNamed(‘Slider_Salad’);
layoutStartTime = hypeDocument.currentTimeInTimelineNamed(‘Slider_Relish’);
layoutStartTime = hypeDocument.currentTimeInTimelineNamed(‘Relish’);
layoutStartTime = hypeDocument.currentTimeInTimelineNamed(‘Salad’);
layoutStartTime = hypeDocument.currentTimeInTimelineNamed(‘Cheese’);
layoutStartTime = hypeDocument.currentTimeInTimelineNamed(‘Topping’);
layoutStartTime = hypeDocument.currentTimeInTimelineNamed(‘Receipt - Bun’);
layoutStartTime = hypeDocument.currentTimeInTimelineNamed(‘Receipt - Topping’);
layoutStartTime = hypeDocument.currentTimeInTimelineNamed(‘Receipt - Cheese’);
layoutStartTime = hypeDocument.currentTimeInTimelineNamed(‘Receipt - Burger’);
layoutStartTime = hypeDocument.currentTimeInTimelineNamed(‘Receipt - Salad’);
layoutStartTime = hypeDocument.currentTimeInTimelineNamed(‘Receipt - Relish’);
}

Any help would be greatly appreciated. The document previews fine on Safari BTW.


#2

You’ll need to share a document so we can see what’s happening. Your logic seems fine so there might be something else that’s causing things as you haven’t shared all the code.


#3

Thanks - how can I share a document but ensure it’s not publicly available to all. My boss is worried about commercial sensitivity and competitors accessing the document. Sorry if I sound paranoid.


#4

no worries - You could share something similar to replicate the problem or you could share privately by Private Message. I would wait to see if anyone else has had a similar issue or if there is nothing then you can send me a PM with it.


(Jonathan Deutsch) #5

You are setting the same layoutStartTime variable for each call, thus it the last call is the only one that will preserve the layoutStartTime. This wouldn’t be the source of the error, but definitely won’t work correctly if you intend each timeline needs to preserve its time independently.

(@DBear is correct we can’t tell what the error is without seeing the document, but my guess would be that the window.layoutStartTime isn’t being initialized before LayoutTimeLoad is called)


#6

I believe this is intended. Obviously would be clear if a document is shared. He mentions that this is one of many variable that are set. So I’m guessing, click a button to set “layoutStartTime” and on another “scene” again this is speculation, set the objects to this start time. I would assume that if it were another variable then there would be code to show this. This is why a document is definitely needed :smiley:


(steve) #7

This post was flagged by the community and is temporarily hidden.


#8

Apologies for seemingly disappearing. I have been on holiday and now that I’m back the project is on hold. I will get back into it assuming it gets the go-ahead.