Hype Project Demo: symbol stop JHSv1.hype.zip (29.0 KB)
There are two separate solutions in this Demo - one for each scene…
A drag action overrides a timeline action applied to an element - in this case the “Rotate” symbol with the “Rotate Angle (Z)” timeline property, and so the rotation stops as soon as the symbol is dragged.
As soon as this symbol loads it begins to rotate - AND - dragging the symbol does not cancel the playing of the “Rotate” symbol’s “Main Timeline”.
Note: The “Rotate” symbol has been given the unique ID of “rotateMe” which is stored in the variable (var) “rotateSymb”. A unique ID for an element is created in the “Identity Inspector” panel.
The script for the function rotateSymbol():
var rotateSymb = hypeDocument.getSymbolInstanceById('rotateMe');
rotateSymb.startTimelineNamed('Main Timeline', hypeDocument.kDirectionForward);
A different approach for this scene - we are going to use a “Custom Behavior” (more about “Custom Behaviors” here - which are a “Hype Pro” only feature).
The following custom behavior (“ContinueSymbolRotate”) was created in the “Symbol Inspector” - which appears when a symbol is entered (opened) in Hype’s interface. I created “ContinueSymbolRotate” in the “click” scene’s “Rotate” symbol:
This custom behavior is triggered in the "click" scene by the "Play" button's "On Mouse Click" handler in the "Actions Inspector":