Using a trigger to change the state of an object

Jun 19, 2014

I'm having a problem with changing the state of an object. 

In the attached example, four boxes show for two seconds each and disappear. I have a Boolean variable that tracks whether overall visibility should be true or false. When it's false, no boxes should appear. When it's true, only the box that corresponds to that point in the timeline should show. I use a trigger that watches when the variable changes and sets the state of each box to "normal" or "hidden." 

What's strange is that at the end of the timeline  when I set the state of "Rectangle 1" to normal it shows, even though the shape only existed for the first two seconds of the timeline. See below...

So my question is, why are these objects showing where they don't belong and how can I fix it? As far as I can tell, the shape should only ever be visible for those two seconds that it exists in the timeline. 

Thanks for taking the time to help,

Erich

7 Replies
Andrew Sellon

Hi!  I confess I didn't download and look at your story file, because based on your description alone, it sounds like you may be overcomplicating your efforts.  If all you want is for each of your four rectangles to appear and then disappear when designated by your timeline (as shown in your screenshot), then the timeline setting is really all you need.  I don't see why you need a variable and trigger setup at all.  It sounds like you're running your timeline, then processing a trigger that is forcing a rectangle to reappear, despite the timeline.

Also keep in mind that Storyline processes trigger commands from the top down in your list.  That's always something to be aware of when you're triggering multiple things.  Sometimes you just have to reorder your commands to ensure that Storyline processes them in the order that you want.

But based on your description, in this case it doesn't sound like you need anything more sophisticated than the timeline alone to make each rectangle appear and then disappear on cue.  Then you can focus on the style of animation in which each rectangle appears and disappears, and fun things like that!  

If this answer solves your problem, please mark this entry as the Verified Answer so that others will know this question has been resolved.

Hope this helps,

Andrew

Erich Renken

I didn't explain that very well. I'm uploading another example that's closer to the result that I'm trying to achieve. 

First, here is a demo:

Demo (two screens)

I want the captions to toggle between visible/invisible and still stay in sync with the audio. On the first screen, I attempt to do this by using states with the captions that listen for a variable change. On the second screen, I attempt to show/hide a layer. The problem with the solution on screen two is that the layer's timeline is paused when it's hidden and the audio gets out of sync.

Basically, I just want to toggle the visibility of these captions that are timed to audio and I can't figure out a way. I'd love to hear of any workarounds or solutions you can think up. Thanks,

Erich

Erich Renken

Bruce, you just blew my mind. 

I had no idea that you could use a "when timeline starts" trigger on individual objects within a timeline to control events. Is this a documented feature of Storyline or just a "cool, well that works" piece of functionality?

If anyone wants to see, here's the published version doing what I wanted it to:

Demo

I'm attaching the SL file, too. There are some crazy caveats to doing it this way. 


  1. I had to use a "pause media" trigger on the slide object and then use a "play media" trigger on an object at .25 seconds in to get the rest of the triggers to work. If I didn't do it that way, the timeline just stopped playing when I got to my first "marker."

  2. All of my "markers" are off-stage. I guess that's the best way to create "events" that trigger at specific points on the timeline. If anyone knows better, I'm all ears.

  3. I used a variable (named "Counter") to keep track of what caption corresponds to the point of the timeline that's playing. That way I could make the appropriate caption visible again.

Good luck if anyone tries to use this in the future. I'm not sure that I'm going to use it because of all the triggers involved. I did finally get it working, though, and that feels good. 

This discussion is closed. You can start a new discussion or contact Articulate Support.