So this is a good problem and I’ll try to explain how FyreVM could solve it…
First, you could do it many different ways. Do you want to change themes? Do you want to change just one css class? Do you want to change the background image? The first thing I would do is decide what happens for this particular “UI change”.
Let’s say we know it’s a background image. This means we’re going to set/change … or if we’re using CSS, ….
We know how to do this with javascript:
document.body.style.backgroundImage = “url(‘myimage.jpg’)”;
Now on the I7 side, we create a new channel:
Include (- Constant FYC_BACKGROUND = (‘B’ * $1000000) + (‘I’ * $10000) + (‘M’ * $100) + ‘G’; -).
To Change the Background:
(- if (is_fyrevm) FyreCall(FY_CHANNEL, FYC_BACKGROUND); -).
Now when we want to change the background, we just do the following:
After doing something interesting:
Change the Background;
say “mynewimage.jpg”;
Select the Main channel.
Now when doing something interesting, the channel “BIMG” will contain the text “mynewimage.jpg”. There are probably simpler ways to write the action that would allow you to just do this:
Change the background to "mynewimage.jpg";
…but I’m just spit-balling here.
Now on the web side of things, the OutputReady() event is going to fire to let you know that all of your channel data is ready to be “handled”. I have it set up to automatically transform channels to the fyrevm global object, so this might come through as:
fyrevm.backgroundImage
Which would allow to do the following:
document.body.style.backgroundImage = “url('” + fyrevm.backgroundImage + “')”;
So now you have a front to back example of how a fyrevm channel, transformed to a client-side fyrevm JSON object, is used to alter the user interface.