I have a multi-state object on every slide of my current project that is dependent on a variable from the user. I already have it working but there was so much in my advanced action that it runs slow now.
What I am going for: The user selects 1 of 10 characters and that character is displayed in the corer of each of the proceeding screens (roughly 30 slides).
So what I did was put a clickbox around each character, then when the user selects one, it sets a variable to XYZ. Then at the beginning of each screen, an advanced action runs that checks for what the variable is and sets the state of the character to the users selection.
This took forever though, because I copied and pasted the original object onto each slide and had to name them character, character1, character2...and so on. Then in the advanced action to check for the variable, I had to use 10 different if statements, all with "if character = X, change state of character to X, change state of character1 to X...and so on"
This created sooooo much within that one advanced action. 300 conditions basically. It was time consuming, I am afraid it will make my project run slower and such.
The Question: Was there an easier, quicker, more efficient way to have this same outcome? Or was this really the only way to do it and I just have to suck it up?
Copy link to clipboard
I think you may have overcooked the complexity here. There is a simpler way.
If the selected object with these 10 character states is supposed to reside in the same spot on each slide, you should put the object on the first slide where it needs to appear and then time it for REST OF PROJECT.
Initially set Visible in Output to OFF so that it is hidden until the user selects their character.
This way you only have one object to worry about and that object will appear on every slide in the project even though it's only on one of the slides. When you need it to be hidden on some particular slide (e.g. quiz question slides), you will only need to place an advanced action on that particular slide which hides ALL objects (to cover all bases) and then another conditional advanced action on any later slide where the user's selected character needs to appear again.
In this case, your idea theoretically works for what I need to do. When the user selects their avatar, it stays small in the top left corner. I mimicked the effect in a quick mock up and it worked great.
When I tried to do it in my actual project though, something is going wrong to where all my other assets are showing up as red squares, so that is a totally different problem hah. I will get it.
Also...are there state views on a master slide? I was thinking maybe that would work. But I am unable to edit states on a master slide object it seems.
You can control states on other slides than the present slide when you use advanced or shared actions. But an object on the master slide has no ID at all, you cannot control its state. However you can use an advanced or shared action On Enter for a Master slide to control the states for an object that is on the slides, or time for the rest of the project.
Do you have exactlhy the same states on all slides, or do you have different characters depending on the slide? Are you talking about a normal or a responsive project? That is not clear from your description.
If they are different, you cannot use the timed for the rest of the project, neither can you for a fluid boxes project. Waiting for your answer to see if shared actions could offer a solution.
Have a look at my blog, I have posted mulitple examples of shared actions. In most projects I use more shared than advanced actions.
You cannot use Advanced Actions to control the state of objects on the Master Slide. Objects there have no Object Name that can be referenced with Actions.