You would communicate between them like you normally would.
Store urls
You can store the urls in a module to (re)use later with something like urls.lua, sending it to one listener.
You can also use something like Britlz’s signal or broadcast
Message to direct address
Call a msg.post() directly to collectionN (you can probably name your collection better to see what they contain).
Pass the address to the popup
When you do monarch.show("item_dialog") you can pass along some data monarch.show("item_dialog", {}, {sender=msg.url()}) you can then grab the data and the sender in your item_dialog.
Thanks @Jerakin for the suggestions.
I especially love your urls.lua module! It’s simple but powerful for this type of situations. I think I’ll go with it.
(Btw, I already tried to change the collectionN name but apparently it isn’t controllable by me. It appears to be generated by Monarch or Defold automatically.)
This thread got me thinking that maybe it would be useful to have a monarch.send(id) function or similar that would do a msg.post() to a URL that can be specified on the screen_proxy/factory.script much in the same way as you can specify a Transition and Focus URL.
Preferable it shouldn’t require an additional field for the user.
If monarch.show("buy_item") show that popup then monarch.send("buy_item", "message_id") should send a message to it.
monarch.show(“buy_item”) will load and enable a collection associated with the key “buy_item”. Monarch knows nothing about the contents of the loaded collection. This is why there is a need to specify a Transition Url and Focus Url.
We could maybe agree upon a standard naming format, saying that for it to work there must be a gameobject with id monarch inside of the collection.