shiatsuJim
(Jim Moore)
November 25, 2021, 10:57am
#1
Hiya
I have an iframe created with hype within a parent html.
In the parent I have instantiated the variable 'rating'
Within the iframe on scene load I have created the script below:
parent.ratingIframe = window;
window.rating = 0;
This does not alter the parents variable 'rating'....
Can anybody tell me what I have done wrong?
Thanks
shiatsuJim
(Jim Moore)
November 25, 2021, 11:07am
#3
Whoa that was quick....thanks MaxZieb,
Not sure how I would intercept the postmessage() and update the variable, could I use a query manager as I would a normal post request?
MaxZieb
(Loves Hype)
November 25, 2021, 11:15am
#4
Have a look at https://gist.github.com/cirocosta/9f730967347faf9efb0b
As an alternative, you can also use Hype GlobalBehavior and Hype CommandPipeline although that might not be necessary for just a simple variable.
shiatsuJim
(Jim Moore)
November 25, 2021, 11:20am
#5
haha just looked at that link seconds before your reply....the only problem is that it is sending the message to the iframe rather than the other way round.
In your expert opinon what would be the quickest way of achieving what I need.
Could you possibly just rough out a bit of pseudo code to give me a starting point?
Thanks again
MaxZieb
(Loves Hype)
November 25, 2021, 11:28am
#6
1 Like
shiatsuJim
(Jim Moore)
November 25, 2021, 11:38am
#7
Max
You're a genius! Now makes total sense... thankyou so much for your time
3 Likes