Drag Control Timeline - fire off events

I’ve read and seen from my trials that I can’t fire timeline actions while performing a drag control timeline. Is there some way to fire off events, through a listener or something of the like. I need to fire off events (javascript functions) at different times along the drag. I like the fluidity of the drag control timeline but I need to be able to have code that will interact with it for it to be use for my needs.

You can also run a javascript function at the same time as the drag. (Look at the action inspector) so you could listen for the current time in the timeline during the drag and then fire off functions when the time is reached. You would probably have to have a few variables fire also to stop it from repeating or firing again if you drag back, etc. Depending on your logic. Also you can check (using the API) whether it’s at the start or moving or at the end, too. Something like…

var time = hypeDocument.currentTimeInTimelineNamed('timeline').toFixed(1);

if(time === 1.0){
    hypeDocument.functions().myFunctionToFire();
}
3 Likes

Thank you DBear. That worked.