changing the state of objects on the base layer from another layer

Feb 05, 2013

Is it possible to access the state of base layer objects from a higher layer?

I'm trying to set up a course where users need to view every object on a slide before advancing - a bad idea, but the client is adamant. There are 3 objects on the base layer that, when clicked, open new layers.  So I set it up so that the next button is disabled until the state of the three base layer objects is 'visited'. So far so good. The user can't advance until they've clicked on each object and opened the popup layer.

Each of the layers has a few markers, and I set it up so the user can't close the layer window until they have viewed every marker. The layer is closed/hidden via  a button on the layer.

Now for the problem - if they open and complete the first two layers, and then open the third layer, the object on the base layer that causes the third layer to open has its state changed to 'visited', so the next button is now enabled, even though they haven't seen everything on the third popup layer.

So I made a new state for the base layer objects called 'completed', and I want to switch the state of the base layer object to 'completed' when the user closes the popup layer window. But to do that, I need to be able to change the state of the base layer objects when I click on a button on a higher layer.

Does that make sense?

46 Replies
Christophe Breemersch

Hello,

Is the following correct: 

1. When you change the status of an object on the base layer, it will keep this state only as long as I am on the current layer. When I close the current layer, the state of the object on the base layer is not saved. 

2. On my second layer, I had hidden the object from the base layer, so it is not visible. When I change the state of the object of the base layer, it becomes visible.

Is there a work-around for these issues? 

thank you,

Christophe

Steve Flowers

Hi, Christophe -

To answer:

1) The state of an object on the base layer is persistent as long as the slide doesn't change, no matter what layer is displayed. Two exceptions to this, 1) if you hide objects on the base layer using the visibility controls of a layer, the object state may change and 2) if you set the slide to resume saved state, persistence of object states on the base layer will "stick".

2) It sounds like you wanted to change the state of the object on the base layer with the trigger. Did you want to change the state of the object and have it still be invisible? Unfortunately, hidden is a state of an object. Selecting another state will force it out of hidden.

I use off stage objects on the base layer to hold logic since the state event is pretty snazzy (all of these, any of these, none of these). By using a combination of object states, you can build "state machine" logic pretty naturally.

Steve Flowers

Yep. I love variables but states of objects are so much easier to manage and there are built-in methods for evaluating the state of multiple objects that is flat out faster than building a stack of triggers or conditions to a trigger.

I move my objects onto the stage to see the state of the machine as the activity progresses, then move them off of the slide when I'm satisfied with how it all works.

Primie Q

Hello articulate community,

I'm a new user of ASL, and I have some things to catch up.

I'm working with my layers, I need help if I can change the state of my object on the first layer when I clicked the another layer?

both layers have audio and objects that has a timing, I want to make my objects present on the other layer but no audio or timing.

Just plain objects..

Can anyone help me on this.Thank you!

Primie

Ashley Terwilliger-Pollard

Hi Primie,

You could show the objects from the base layer through to another layer as long as you don't choose to hide the base layer within your layer properties. In terms of adjusting the state of an object, you should be able to do this with a trigger on the layer itself - if you're having difficulty with a file could you share a copy of the .story file here with us?

Heather Beaudoin

I have three objects on the base layer with Normal, Hover, and Selected states. Clicking the objects opens one of three layers. It mostly works.  I included a close button on each layer so there's a way to go back to none of the three layers being opened.  If you choose that close button, the last Selected state persists instead of going back to Normal.

I tried adding a Visited state to all three and had it match the Normal state, but that didn't work. I haven't found a way to trigger a state change on the base layer when I close a layer. Can I do that?

Michael Hinze
Heather Steckley

I have three objects on the base layer with Normal, Hover, and Selected states. Clicking the objects opens one of three layers. It mostly works.  I included a close button on each layer so there's a way to go back to none of the three layers being opened.  If you choose that close button, the last Selected state persists instead of going back to Normal.

I tried adding a Visited state to all three and had it match the Normal state, but that didn't work. I haven't found a way to trigger a state change on the base layer when I close a layer. Can I do that?

Yes, you can change the state of a baselayer object from another layer. Maybe this is an issue with the order of triggers. Can you share your .story file here so that we can have a look?

Michael Shannon

Sarah, if you mean a tab that you've created then you'll need to have a state of that object that reflects the color that you want. So, for instance, if you have a tab on the base layer that is blue and you open a layer and want that blue tab to turn grey two things have to happen:
1. The blue tab has to have a state with a color of grey (let's call this state "opened")
2. The layer has to contain a trigger that changes the state of the blue tab to "opened"

Leslie Steele

I have SEVERAL slides that each have several objects, text boxes mostly.  I want the following behavior: the user clicks one of the text boxes and simultaneously the corresponding layer appears and the state of the text box changes to its clicked state.  When the user clicks another text box, that text boxes changes to its clicked state, the corresponding layer appears, and the original text box changes to its normal state. The user should be able to click any text box from any layer and get the same behavior. 

I have three triggers for the first object (parking lot): one to change the state to "clicked" when the object is clicked, one to display the corresponding layer, and one to change the state back to "normal" when the clicks outside the text box.  What's happening now is when I click the first text box, the corresponding layer appears. I have to click it again to get the state to change to its clicked state. No matter how many times I click, the state never changes back.

What am I doing wrong?  Should I have to create three triggers for every text box in my project? (There are hundreds).  I had completed about half of my project before I realized that "states" would probably be a better approach than what I was doing (manually giving every text box a "fill" color on every layer).  My project was working fine, but I think using states would be better for a few reasons.

Please help! See attached file.

Thank you,

Leslie

 

Walt Hamilton

Leslie,

Does the attached version do what you want? I made changes to the parking lot and trash area buttons and layers.

I used the built-in "Visited" function to indicate that the layers had been clicked. I duplicated your clicked layer, and named it Visited. Now it has all the hardwired functions. Visited doesn't work well if you are going to other slides and/or have complicated branching, but it is perfectly reliable if you are staying on the same slide and visiting layers. There is no need to duplicate those triggers.

In the two layers, I set the background to have no fill. That allows the base buttons to show through, and be functional. If there is something on the base you don't want showing on the layers, I hid that on the parking Lot with a shape.

I hid the buttons on the two layers, but did not erase them. I did erase the home button on the home page. HUGE personal peeve of mine is to have a button on a page that jumps to the page it is on!! But that's just me, and YMMV.

I did leave the home button on each layer, and attached a trigger to it to close the layer.  Since all the layers close the others, closing that layer is the same as going home.

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