Using states to create select and deselect

Sep 27, 2012

How do I set my triggers to make an object appear selected when clicked once and normal when clicked again?

Cant seem to get it to work

22 Replies
Mike Enders

Michael,

That's a tough egg to crack.  If you only use triggers, it's not going to work because both triggers are associated with the button and both fire each time you click.  Hence, they interfere with one another.  To do this, you'll need a little variable helper and some cool coding.

Get ready to Toggle your Variable!

I've attached the sample on how you accomplish this.

Mike

Jamie Morgan

I'm not sure if there is functionality in the triggers to accomplish that. I'll let others weigh in though.

As a work-around, you could use a slide layer that contains the same object with the "selected" state. When the user clicks the object on the base layer, simply show the selected layer (which is nothing more than the same object with some indication that it's selected). On that selected layer, have a trigger that hides the layer when the user clicks on the selected object. In essence, you'd be toggling the selected layer on and off to simulate the click once to turn on, click again to turn off effect.

Michael  Rice

Your fix is working really well.

Is there a way to make that on/off status reflect to another object on another slide? i.e.

To use your example:

When I select the rectangle and change its state, can I have that state reflected in a "mini rectangle" on another slide.

Is that some sort of call to the variable?

Thanks in advance!

Michael  Rice

In between the time that I wrote and the time you responded the scales fell from my eyes.

I select it on one slide, it shows what I selected on another and displays that in a chart.

I will put up a demo when it is complete and scoured.

Thanks for your help. I just needed a push to turn the engine over!

Michael  Rice

Thanks,

I do have one last little question.

As you may have surmized, I am using variable staements to show, on a single slide, a list of selections that are made over a couple of slides.

Select the rectangle on slide 5 and it shows up in a list  of all choices possible on slide 7 as one of your choices. (using selected state with a glow)

I have set a trigger on the "results" slide that says the following:

Action: Change state of

On Object: rectangle

To stat: Selected

When: Timeline starts

Object: 2,3 Results Slide

On Condition: Variable 1 = = Equal to False

And that is where my question lies - does it matter if I set the object as the slide or the rectangle?  

ie: Object: rectangle or Object: 2,3 Results Slide

It seems to work both ways.

Jamie Morgan

You'd want the object to be when you want the trigger to fire. Having it occur at the start of the rectangle or the start of the slide may be 2 different things in some cases. Granted, if the rectangle comes on at the start of the slide, then they both will function in the same manner. However, if the rectangle doesn't come on the slide until 3 or 4 seconds in - then the trigger won't fire until that time as that would be the start of the rectangle.

If I'm wanting triggers to fire when a slide first loads, then I always will use the timeline starts for the slide itself.

Esther Ramirios

Thanks Mike! I know this post has been around for 8 years and I was excited to find it along with your example. I believe you just saved me hours of useless trigger programming! 

I hadn't even thought about using a variable. It all makes sense now.  It worked out and now I have a beautiful working slide. 

Thank you!