Flux Product Docs
  • What is Flux?
  • Guides
    • Creating a Premium Video
    • Creating Your First Site
    • Creating a Countdown
    • Creating a Navigation Bar
    • Creating a Group
    • Custom 404 Page
    • Adding a Favicon to Your Site
    • Adding Videos to Your Site
    • Managing Your Guest List
    • Asset Management
    • Creating Sites from Site Templates
    • Publishing Site Versions
    • Advanced Debugging
  • Fundamentals
    • Key Concepts
    • Sites
    • Guests
    • Environments
      • Show Variables
    • Flows
      • Anatomy of a Node
      • Connecting Nodes and Building Flows
      • Passing Data
      • Scope
      • Interpolation
    • Keyboard Shortcuts
      • Keyboard Shortcuts - Page Editor
    • Animation States
    • Local Variables
    • Groups
  • Use Cases
    • For Designers
    • For Engineers
      • Custom CSS
      • Custom Modules
    • For Event Manager
      • Intercom Integration
  • Documentation
    • FAQ
    • Glossary
    • 🚀Show Controller
      • Modes
    • Domains and Subdomains
      • Hover
      • AWS Route 53
    • Premium Live Channels
    • Basic Video
    • Premium Video
      • AI Generated Subtitles
      • Supported Input Codecs and Containers
      • Supported Language Labels
      • Serverside Forensic Watermarking
    • Flow Nodes
      • Middleware
  • Modules
    • Access Code
    • Audio
    • Button
    • Carousel
    • Chat
    • Checkbox
    • Container
    • Countdown
    • Date
    • Embed
    • Image
    • Intercom
    • Link
    • Lottie
    • Page
    • Meter
    • Modal
    • Photobooth Gallery
    • Open Login
    • QR Code
    • Radio
    • Rich Text
    • Stack
    • Style
    • Spline
    • Switch
    • Text Input
    • Video
  • Template Guides
    • NatGeo FYC
      • Adding a Panel
    • Meow Wolf All Shrimps
  • 🚀Change Logs
    • July 12, 2024
    • June 08, 2024
    • April 26, 2024
    • April 12, 2024
    • March 29, 2024
    • March 15, 2024
    • March 1, 2024
    • September 2022
    • August 2022
    • July 2022
    • June 2022
Powered by GitBook
On this page
  • Setting a Local Variable
  • Reading a Local Variable
  • Example Usage

Was this helpful?

  1. Fundamentals

Local Variables

Last updated 2 years ago

Was this helpful?

Local Variables are variables which are local to the specific guest. Local Variables can be set using the Flow Controller, and can be used in other Flows to control behavior.

Setting a Local Variable

To set a local variable, use the Set Local Variable listener.

The listener takes a Key and a Value. The key is the name of the variable, and the value is the new value you want to set that variable to.

Reading a Local Variable

To read a local variable, and use it in a Flow, use the Read Local Variable value Node.

The value node takes a Key. The key is the name of the variable you want to get the current value of. The Value output will send the current value of the Local Variable to the next node in the Flow.

Example Usage

Say we want to keep track of whether the guest has a chat panel open. We can use a Local Variable to keep track of the local state of that panel.

This is just an example.

To create this yourself, you'll need to make the animation states on a Stacked module.

Here, we build a Flow from the Button:on-click Broadcaster. When this button is clicked, we pressurize an Equals Node.

We pass the current value of chatPanelOpen into this Equals, and check if it's set to TRUE.

If the Local Variable is TRUE (meaning the panel is currently open), we set the animation state of the panel to closed, and set the Local Variable to FALSE.

If the Local Variable is not TRUE (meaning the panel is currently closed), we set the animation state of the panel to open, and set the Local Variable to TRUE.

For a detailed look at Flows, check out the page.

Flows Fundamentals
Set Local Variable Listener Node
Read Local Variable Value Node
Toggle a panel using Local Variables
Example Flow