Another question on variables.
Nov 08, 2012
By
Jill McNair
I have a slide with 5 layers on it. The user clicks on arrows right or left to move through the layers. I need to set up a conditional next button (hidden until they visit all 5 layers).
Here is what I have done and sadly, it is not working.
- I have created 5 "LayerVisited" variables - one for each layer. They are T/F variables with the initial value set to false.
- On each of the five layers, I created a trigger to change the appropriate "LayerVisited" variable to true when the timeline starts on that layer.
- On the base layer, I created a Next button and set it's initial state to hidden. (I've turned off the built-in Next and Previous buttons)
- I then created this trigger:
Action: Change the state of
On Object: Next Button (my manual one)
To State: Normal
When: Variable changes
Variable: Layer1Visited
On Condition:
Layer1Visited = True
AND Layer2Visited = True
AND Layer3Visited = True
AND Layer4Visited = True
AND Layer5Visited = True
The state of the Next button does not change. Please help me identify where I have gone wrong in my logic here.
Thanks!
Jill
8 Replies
Hi, Jill -
Might be easier to use states of objects off the stage to accomplish this.
Create a shape off your stage on the base layer. Add a visited state to the shape. Copy this shape 5 times off of your stage. On each layer, add a trigger to change the state of each corresponding shape to visited when the layer is shown.
Now that you have 5 shape objects with states, you can use the "When States" trigger to select "All of" checked objects have been visited to toggle your next button to active.
That's the way I'd tackle it Unless you wanted to maintain the variable between slides, many times it makes sense to use object states to hold your logic state.
Hi Steve,
That is actually what I tried first, but when I went to set the trigger to change the state of the next button - only objects on the base layer are available on the checkbox list. The layer objects are not listed there, so I tried to add them using conditions - I've included a copy of my trigger panel. This unfortunately did not work. Did I do something wrong?
Hi, Jill -
Yeah, I'd place all of your objects on the base layer. You should be able to target them from triggers in the layers.
Can you upload the file? I would be happy to take a look at it.
Hi Jill and Everyone,
I'm uploading a story I created here and am interested to know if it accomplishes what you're looking for Jill. Steve, I used your instructions. I only did 3 layers, but it can be used for any number of layers
Anyone: if you look at the Notes, you'll see that I took notes as I was creating this. I'd given it a go several times before this and was really not getting very far, so I backed up and went one step at a time. I'm not suggesting it needs to be done in tiny increments like this. It just wasn't working for me and I'd get way off the path and not be able to get back on.
Probably shouldn't say so, but I did find this challenging! And there aren't even any variables here :-(
Part of my perplexity is around what I'm about to write, and I'm hoping someone will jump in and answer. If not, I can start a new thread:
When duplicating layers,
Why am I sometimes (actually usually) not able to see Title Text boxes on a new layer even though I've not hidden them in the Base Layer Objects for that new layer? I included a blank layer 4 here just to show you what I mean, although I don't know what y'all will see. This layer isn't part of the "solution, it's just to ask this question.
When I look Layer 4 in slide view, I cannot see the title box from the base layer. I have NOT hidden the title box in the Base Layer Object section. But when I'm in Preview Mode, the Base Layer Title Box shows. I know I've had this same phenomenon happen with other objects at times. It's caused me to go in and out of preview mode to figure out what's really going on. Pretty time consuming. I'd appreciate any direction in understanding what I'm doing wrong and how to avoid this.
@ Steve - you saved the day (as usual!) Thank you!
@ Jerson - I managed to figure it out, but I appreciate your offer!
@ Rebecca - you came up with the same solution I did! Thanks for posting it - I was going to, but haven't had the chance.
In response to your questions (my opinion that is)... I think that whether to duplicate a layer is based on what is built on the layer. If you need some of the same elements on the next layer, why not duplicate the layer so you don't have to copy and paste or align them? For example, say one layer has a picture on it, and the second layer has a different picture, but in the same location. You could duplicate the layer, right click on the photo and select "change picture." Save those keystrokes!
For your question regarding layer 4, I think that you have managed at some point to close the visibility of the base layer (it was off on the file you sent). Here is a pic of what I mean (I turned it back on):
Hope this helps! Thanks to all for the assistance and offers of assistance. I am so grateful for this community!
Jill
Hi Jill,
Well, tx! What was odd as I was working was that I could see other objects. Or I thought I could. I obviously must have been mistaken.
Thanks for chiming in about duplicating layers. I think the only reason that justifies duplication is when the majority of the items are needing to be duplicated. Your point is taken about changing a picture and not needing to realign it, but then again you need to go ahead and delete a lot of objects (potentially) or move them out of the way depending on what's going on with the new layer.
So I guess I was just wondering if there was anything more to it than that. Or if it's as simple as: evaluate what's going on in each layer and decide what's going to cause more work.
I can't speak for anyone else - but I decide whether to duplicate based on what is on the layer. To me the whole idea is to minimize the number of actions that I have to take. I want to increase efficiency and cut down dev time. Sometimes I plan in advance to duplicate layers because they are really similar - in that case, I build out layer one completely before duplicating. Maybe someone else sees it differently?
Jill
This discussion is closed. You can start a new discussion or contact Articulate Support.