Sending variable to parent window from iframe


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?


is the safest bet.

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?

Have a look at

As an alternative, you can also use Hype GlobalBehavior and Hype CommandPipeline although that might not be necessary for just a simple variable.

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 :slight_smile: (17,6 KB)

1 Like


You're a genius! Now makes total sense... thankyou so much for your time :slight_smile: