JSON loaded images when clicked goes to next scene

Good afternoon everyone!

This is my first HYPE project. I am working on a collection kiosk for a museum that will be relatively easy for them to update if need be.

So far, in the gallery portion of the document images are populated from a JSON file. From here I can manipulate the innerHTML of the next scene to showcase the object’s information. My only set back is that I can’t seem to switch to the next scene by clicking on one of the images.The error I get is “Uncaught ReferenceError: hypeDocument is not definedonclick @ index.html:1”

What am I missing?

SearchKioskVersion2.zip (568.9 KB)

Hi @nora00

I’m guessing nobody has tried to help you because they can’t make sense of your document. :smile:

i appreciate you’re new to Hype. What about Javascript? Are you familiar with how to use it?

Can we clarify what it is you are wanting to do. Having looked at your document I cannot see where you are calling your function FineArtTheme(), If you are calling it at all.

For clarification, from the Gallery scene, Do you want to populate the scene with images from your resource folder and upon clicking one of the images you would like the next scene to update with the same image and perhaps information about the image and at the same time transition to that scene with the same click?

Let us know a little more about what you need and then perhaps show us what you’ve done in a cleaner document.

Here is an example of what I think you want: searchKiosk-vDBear

It Includes:
• splash screen with button to enter
• timer on main gallery screen so if no user interaction after a set time it goes back to splash screen.
• All content is taken from JSON file.

Let me know if this is what you need and I’ll be happy to send you the file.

It is called from the FineArt symbol on the second Scene

@DBear is right,

It was a little hard in figuring out the workflow of this project especially when the bit that you wanted help with was not included. i.e how you were adding the onclick.

So a few things I fixed.

1, On the first Scene II moved your Search and Survey buttons to the top layers above the text.
This is so a user does not click the text instead of the button and think WTF.

2, On Scene 2, I removed the call for the FineArtTheme() function and scene jump, which you had on the symbol. You already had it within the symbol and did not need it called twice.

3, Added the hype callback function in the head which will allow you to make calls to the hypeDocument from your onlick.

4, Added the onclick to the IMG tags. This will now call another Hype function to go to the Objects scene.

5, Added references to the IMG tag for the other bits of meta data you need for the Objects scene.

6, Wrote the function to populate the Objects scene using the meter data previously added to the IMG tag.

7, removed the call in the FineArtTheme() function to test(). ???

8, Added a Themes img/Button and fixed some of the logic of where the buttons lead to.

I.e you had the back button going to the home page when it should be going back to Gallery and so on…

9, You can control the Objects scene’s image alignment by selecting the ObjectStage element and the use the Typography Inspectors text Alignment settings. Left, centred, right.

SearchKioskVersion2-2.hypetemplate.zip (660.6 KB)f

1 Like

Thank you @DBear for pointing me to an example - I will study it with great detail.

@MarkHunte thank you for making all of those improvements! I’m taking note of all of the improvements - there is so much to learn from. I greatly appreciate this. I have a much better understanding of how Hype works now.

I’ll be more detailed next time as well :smile:

Thank you again.

1 Like


Here is a copy of my file so you can see a way of doing it without jQuery for reference.

I have nothing against jQuery but unless you’re using it for other things it might be a bit overkill. :smile:

Also, I added the timeout feature as I thought that would be a good thing if it’s being used in a museum. When users walk away from it for example.

searchKiosk-vDBear.hype.zip (393.6 KB)

1 Like

@DBear For some reason I can’t seem to open this file. Hype keeps crashing when I open the file. I’ve encountered the same problem when I try to open other files on the forum as well. I am using Version 3.5.1 (526) Professional Edition. I get this -

That’s odd – opens fine for me. Could you please submit an issue from within Hype, using Help > Report an Issue?

HI Daniel,
I submitted the issue report earlier this morning. Sometimes the automatic window to send a report doesn’t pop-up, I’ll just get the report submission window from Apple (the screenshot I attached previously).