[plugin] rex_frame_message

Post your completed addons to share with the community

Post » Wed Dec 30, 2015 4:53 am

The idea of this plugin is came from @pode 's postMessage plugin.

Each project is running in a frame, which could be addressed by a frame name in this plugin. Since iframe could be added into layout to run other project by URL, it is possible to have multiple frames in an environment.
This plugin could send or receive function calls from other frames, i.e. communicate between projects.
Document, included plugin and sample capx.
B
108
S
26
G
267
Posts: 4,456
Reputation: 149,747

Post » Sat Jan 02, 2016 10:02 am

i am away at the moment so i cant test this. Does this mean each frame will run at the same time?
B
48
S
16
G
9
Posts: 1,097
Reputation: 11,195

Post » Sat Jan 02, 2016 10:47 am

@spongehammer

Yes, each frame runs at the same time, but the tick of each frame is individual. The communication between frames is asynchronously, like network.
Last edited by rexrainbow on Sat Jan 02, 2016 11:15 am, edited 1 time in total.
B
108
S
26
G
267
Posts: 4,456
Reputation: 149,747

Post » Sat Jan 02, 2016 11:11 am

Designer could plan this kind of architecture -
- a main frame to control the main menu
- a child frame to display each level which made by individual project (capx) , and communicate between main frame by this plugin.

It could only load resource of a level, not all levels.
B
108
S
26
G
267
Posts: 4,456
Reputation: 149,747

Post » Sun Apr 10, 2016 10:34 am

Here are sample capxs to show how to recognize the main frame.
Daughter, mother

Daughter (child frame) will be embedded into mother (main frame), how to recognize the main frame from child frame?

A possible solution is using frame message plugin -

In daughter capx,
1. call function "Mom?"
2. wait 0.1 second
3. check the global variable "FindMyMom"
And this capx has a return handler of "Mom?" which sets global variable "FindMyMom".

In mother capx, it has a function body "Mom?" which return a value to daughter.

If the daughter frame is not embedded in mother frame, the return handler of "Mom?" will not be triggered, so global variable "FindMyMom" will not be set.
B
108
S
26
G
267
Posts: 4,456
Reputation: 149,747

Post » Sun Feb 19, 2017 11:47 pm

A thousand thank you's, rexrainbow! I had been trying for several days to get my iframe-embedded page/project to communicate with the parent page/project by using localstorage keys. It worked sometimes--and sometimes not. Then it wouldn't work at all...

As soon as I used your plugin, however, to use the embedded page to call a function in the parent page, it worked immediately. I almost fell out of my chair. Thanks again! :D

Edit: I did more testing with different functions and in different browsers. It works so well that I wonder why it's still in the "Work In Progress Addons" section. :? :?:
B
11
S
2
Posts: 24
Reputation: 686

Post » Sat Feb 25, 2017 5:14 pm

@terransage

This plugin had too few users. As you saw, there were only 3 users included me in thread, therefore I had forgot this plugin before.
BTW, thanks for your testing.

@Kyatric
Please help me move this thread to completed addons section,
B
108
S
26
G
267
Posts: 4,456
Reputation: 149,747

Post » Mon Feb 27, 2017 10:45 am

Moved as requested.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
289
S
112
G
94
Posts: 7,333
Reputation: 69,293


Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests