question on variable = assignment

Hey folks,

Been working pretty comfortably with variables over the last while. I use variable toggles pretty consistently for buttons and states. For these I use the true/false and the = not assignment aspect. So I click a button and it toggles true and false using the = not assignment. 


I've never been able to see someone explain the = assignment aspect and when it can be used. Any insiders?

8 Replies
Wendy Farmer

Hi James

i use that to 'set' a variable to its assignment so it might be a variable that starts off as t/f with a default of false.

So it appears as a trigger in my slide,  adjust variable = assignment of itself when timeline starts.

Then I have actions happening and then I might have the next trigger that says, adjust variable, variable x when state of all x, y, z are selected.

Hope that makes sense.

james lavis

so for example if I have a button and I can use the = assignment to change a variable to say true if they click the button. The = not assignment is merely for toggling a variable.

So on another note related to variables. If I have three true or false variables sitting on false, I can have 3 buttons linked to activate those using the =assignment. Now, if I want a variable that looks for when all three are true and it'll show a layer, what would be the best place to put that condition, on the slide when the timeline starts? or have a condition on all three buttons that if all three variables are true, then show layer? I know in flash you can have a variable "scan" for when conditions happen. Whats the best way to have something like this?

james lavis

thanks wendy I'll take a look. I'm doing a variable map as I'm working on a little more complex of a project that will be a proof of concept before I get this coded out in the future. One thing I miss in other languages is the ability to move the X and Y values of an object based off a trigger.

So why I'm looking at these variables is that once the user completes tasks, each task will be assigned to change the state of a star. Easy stuff there. Click the task trigger, change star variable to true and it's state to something like lit.

Where this gets complicated is I have a menu that displays these stars. The stars have to move with the menu during it's up and down states (vertically moving). So without the ability to move these stars I'll have two menus with states for each star lit possibility. Show one star menu when it's up or down and have it adjust as the user accumulates stars. Pain in the butt.

james lavis

thanks wendy, after pretty tedious variable chart it works. There are abilities that I have used in flash that I'd love to see come over. Having the ability to delay something after a variable change or trigger. Also manipulation of the x and y axis because of a variable...the list goes on but hey it works for now!