Ontimeupdate Event for timelines

What would really be helpful if we could have a ontimeupdate event for time lines. which also includes the scene it is running on and time line name

This would not be set to fire on every time line but set to fire by ui check box (only suggesting that bit if there is a worry of overhead)

Including on symbol/sprite time lines.
This would save us having to write our own.
Especially on sprite where we cannot use the math function work around as such.

Maybe something like.

hypeDocument.ontimelinetimeupadate(timelinename,onsenename) = function(){ code… };

3 Likes

Why invent a new notification schema. Just enable notification in the IDE in the timeline panel. And then receive the update as HypeTimelineUpdate with the regular way Hype handles updates like HypeSceneLoad etc. only difference is that this event has to be enabled.

1 Like

Also To be able differentiate between scenes.
I.e symbol/sprite/ scene may have same named timelines as well as the same named Main Timeline

As well as a Symbol or sprite in a scene/symbol

Hence the property of its scene/symbol/ sprite name or id.

Do you mind describing your specific use case? I know generally why someone wants this but it is useful to grab a corpus of needs for the design - for example one open question is if it should be called before or after Hype does its animation work. Thanks!

Many cases we need mutation observer for could be supported natively. Act when the timeline progresses or on specific value changes. Currently we need to watch timeline offsets or values that are connected to a timeline. I could even see it not firing on every value change in a timeline. To narrow notifications even further down it could be attached to a attribute in the timeline.

If that not an option and we keep it simple and notify about all events in a timeline (it’s certainly a simpler UI then the previous suggestion) meta information like the timeline name, attribute name and value and other meta information could be provided in the event object passed by notify. Also the element is part of this call.

I actually hacked the runtime once todo just that but it did fire on any value change and passed in the unresolved attributes.

1 Like

Before because if run through notify event a potential return value could be a tweaked value.

https://www2.aachener-zeitung.de/zva/karlo/MHA-Charts/wi_ihk-konjunkturumfrage/

A simple usecase would bei to Update some Charts …

1 Like

Yes all of the above.

It seems there are times when we want to know when a timeline is at a particular stage so we can do a few things.

My original thoughts were in the scope of questions like these.

The main thing is we have to poll or request the currenttime in a time line manually or write our own code using mutation observer, poll via setInteval or/and requestanimationFrame to run code when the time is right.

The closest thing to a timeline onupdate is using a Math Equation within an easing to run a hype function ( outside its own scope) aliased to a global. ( also which cannot be accessed within a sprite )

An on event or as @MaxZieb suggests an optional registration to a HypeTimelineUpdate event would possibly make it easier to innovate and understand and writ for the masses. In particular doing away with the cumbersome setInteval and complex mutation observer.

This is not saying it will not have it's own challanges...

2 Likes

Thanks!