Snap back inside a symbol


(Rick) #1

There was an topic recently with a snap back request that got solved by Mark Hunte: https://forums.tumult.com/t/on-mouse-up-not-the-droids-i-was-looking-for/

It works like a charm until I move the snap back items into a symbol then the droids stop working. :sob:
snapback_symbolfail.hype.zip (38.2 KB)

Did I forget to oil the droids in some parts or is there a way to make this work inside a symbol? :sweat_smile:


(Mark Hunte) #2

It is a symbol so you have to use the symbol APIs

Give the symbol the ID of ‘dragnFlipBack’

Then use:

		var dragnFlipBack =  hypeDocument.getSymbolInstanceById('dragnFlipBack')
		
		if (event['hypeGesturePhase'] == hypeDocument.kHypeGesturePhaseEnd){
 
 dragnFlipBack.goToTimeInTimelineNamed(0, 'Drag')
 
 
 dragnFlipBack.continueTimelineNamed('test2', hypeDocument.kDirectionForward, true)
 }

(Rick) #3

Oh, I never realized Symbols where that different. :sweat:

Thank you for taking the time and the enlightenment!