iFrame messaging with Javascript in v9

I’m having good luck using

javascript:window.frames[0].$axure(’@changeme’).SetPanelState(2, {}, false); void(0);
javascript:window.parent.$axure(’@moveme’).moveBy(0,0,{}); void(0);

to communicate between iframes and parent…

just wondering… is there any way to send text strings between frames? … so far I couldn’t get @object.text() @object.value() or @object.val() to work…

thanks much

I don’t think those methods exist on the AxQuery object, but I haven’t spent too much time exploring it in depth in Axure 9. I don’t think there’s a simple API for setting text like there is for setting panel states or moving widgets.

Unless you have lots of different text, I’d just use a global variable to pass store the value and then trigger a move on a widget that has an OnMove case to take that variable and set the text on the final widget.

I think that the child frame will not see the global variable update after it loads

I.e. the child page gets the global variables when it first loads but it would have to be reloaded every time there’s a variable update in the parent… !?

You tried it and it didn’t work?

You don’t have to reload the child page to get updated values, you just need to trigger an event on that page to get and do things with global variables. You can set up a dynamic panel (dp) to do this automatically at regular intervals. The dp doesn’t need to have any content, just two states. In the Loaded event, set “Change panel state of This to next, wrap, repeat every 1000ms” (or whatever interval you like.) Then use the Changed State event to test the values of global variables and act accordingly.