Event for "Experience Loaded"?

Which event fires as soon as the experience is loaded? I don’t mean the “seen” event for a tracked image, but rather an event that fires when the experience itself is “ready”. I’ve searched the docs, but I must be overlooking something (or using the incorrect search term). I’m guessing that I’m missing something really simple. :confused:

(Basically, once the experience is loaded, I’d like to instruct the user to do something to reveal a tracked image.)

1 Like

Ok so this maybe wrong. I’m just doing this off of the top of my head.
I think you want on Ready from root. To start your experience. Then you can use https://docs.zap.works/studio/scripting/reference/targetgroup/functions/trackingenabled-getter/
To turn on the tracking image.
You will want to set whatever your doing to z.screen till your tracking image is on.

You will have to test it to make sure.

Steve

1 Like

You can just use parent ready on the main symbol.

1 Like

Hi @shot,

A ready event will fire when the given node is loaded. Most nodes can be dragged directly into a script to create a ready event. You can also right-click on the root node to create a root ready event handler, which will run once the experience is launched.

You will get an event handler like this -

parent.on("ready", () => {
	// Runs when ready occurs on the parent node

        //Activate prompt to user here. 

});

Much like ready events, target images also fire seen and not seen events respectively. Right-clicking or dragging the target image into a script will allow for seen and not seen event handlers to be created.

symbol.nodes.Target_Image.on("seen", () => {
	// Runs when seen occurs on the Target Image.jpg.zpt node
	
	//Activate tracked content
});
symbol.nodes.Target_Image.on("notseen", () => {
	// Runs when notseen occurs on the Target Image node
	
	//Activate user prompt
});

Here’s an example project that might help - Seen and not seen example.zpp (300.3 KB)

You can find lots more information about this here, as well how the above can be set up using Actions.

Hope this helps.

George

1 Like

Thanks @George and @stevesanerd. “ready” on the root node is I think what I’m after. I already have “seen” and “notseen” working. :+1:

2 Likes