Control Scenes From Other Scenes?


(Bryann) #1

Just wondering if anyone has a tip for me.
I have a file that auto collapses on the main timeline (a timeline action after 8 seconds).
After the user expands the ad again (from another scene), I do not want it to collapse the second time.
How to I keep this from collapsing after the first instance, without having to copy the Scene?

Thanks!


#2

Needs JavaScript

  • You could use a global variable, to store the state of the menu. Then, when the scene is reloaded, you can load the appropriate keyframe. Example…

window.menustate = "Open"

http://www.w3schools.com/js/js_scope.asp

That needs JavaScript.

An alternative, but I didn’t test it, would be to create the menu as a persistent symbol. You could just hide it when it’s on the other scenes. Then, when back to the main scene, just show it again. This way, it should be at the same menu state.


(Jonathan Deutsch) #3

This would be my recommendation; Persistent Symbols “stay alive” and thus will retain state across scenes.


(Bryann) #4

So there’s no way to do it without code, except to clone the scene without the collapse?


(Jonathan Deutsch) #5

It depends on how things are setup, but one technique I’ve seen use in lieu of code for a single-time action that is something on the timeline is to use the ‘continue timeline’ action with the option to not restart the timeline. If you have some timeline action at the beginning of the timeline, it will get triggered once on your action. Then, any other calls will be ignored, because the playhead is going to be at the end.

It gets a little more complicated to use this technique if you are using different scenes, but a global state could be made in a persistent symbol, with the timeline existing inside. The way to communicate to this is through Custom Behaviors.

A better recommendation would entail getting a look at your document… and after all this ot might be that the code approach is easier :slight_smile:!


(Bryann) #6

The document is very simple. Here’s the example.control-the-scene-closing.hype.zip (22.8 KB)


(Hans-Gerd Claßen) #7

1.) remove the timelineaction
2.) create an empty persistant symbol
3.) open this symbol
4.) recreate the timelineaction within

it’ll run only once


(Bryann) #8

Thank you dear sir.