Skip to main content
Question

Setting variables not working correctly and "phantom variables"

  • April 12, 2024
  • 1 reply
  • 184 views

Christian_Takagi

Hello, everybody!

I faced some weeeeeird behaviors last night. I fixed that problem for one file, but when I tried to make a new one in order to reproduce the workaround, that didn’t work.

I wanted to make a dialog pop-up, where users could chose an option that would reflect in the main screen (imagine a MFA screen, where the user can change the channel in which they’d receive the code).

The bug is that the options just doesn’t update correctly:

demo

What I did to fix the problem in the original file, was to create a duplicate of the variable and use that duplicate to update the original variable.

So, in the interactions I’d do something like this (I’ll be using some pseudo code syntax here):
On Click () { var1 = var2 }

But that var2 would actually contain the Mode I wanted, so something more like:
On Click () { var1 = var2:modeA }

In the file I’ve uploaded, though, that workaround did not fixed the problem (as seen in the gif). It looks like the action of setting the variable do nothing, or that the variable is getting some cached value from somewhere else.

Phantom Variables.fig (35.7 KB)

NOTE: I also tried to reproduce with no success a “phantom variable” I got in the og file. That happened when I deleted a variable and created another one with the same name, but different content in each mode. When I tried to update the link between the text layer and the variable, one of the layers didn’t show the (?) thing from a deleted variable. Instead, it showed it active, without the (?) mark, and with the old content.

Did anybody faced something similar to this?

Christian_Takagi

Let me upload some screenshots of the interactions and variables also:

Conditional interaction setup - to open the appropriated overlay

On click interaction setup - setting up variables and closing the overlay
Captura de tela 2024-04-12 135910

Local variables with the hack I made

On click interaction with hack - setting a variable to another variable
Captura de tela 2024-04-12 142450


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings