Cross-Layout object properties and animations


Hi all,

I’m not quite sure how to explain my following issue but my problem is that when I animate or change properties of objects within one layout, the (same) objects in other layouts don’t respond correctly. So what happens is:

  1. I animate or change a property of an object (with ID ‘ObjectID’) through a button
    hypeDocument.setElementProperty(hypeDocument.getElementById('ObjectID'), 'rotateZ', -360, 3, 'easeinout');
    hypeDocument.setElementProperty(hypeDocument.getElementById('ObjectID'), 'opacity', 0, 0.0001, 'easeinout');
  2. I scale the viewport until a different layout triggers.
  3. the object is now still visible (as if the whole layout is unaffected) by the code or the active animation just stops.

As I am working on a responsive game, it is necessary for me to be able to switch between layouts without forcing the player to restart the game each time a layout-switch has occurred.

All timeline related changes to objects (and their properties) seem unaffected by this behaviour. They keep working through all the layouts.

Any ideas?

(Hans-Gerd Claßen) #2

A Id has to be unique. You should work with classes in Layouts…

(Jonathan Deutsch) #3

Layouts are effectively different scenes; scenes have independent elements. The way around this is to put something in a Persistent Symbol which will keep all the elements the same within.