Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Sprite Image begin on click

I have this and it works fine but I want the animation only start when a user touches the screen. I try changing the begin="enable" to begin="click" or "mousedown" but it does not seemed to work. Is there something else I need to change to make it start only when user touches the screen ?

 

<symbol id="bgframes" href="#sprite-image">
<animate id="anim" attributeName="value" begin="enable"
from="1" to="15" dur="4"
repeatDur="30" repeatCount="indefinite" />
<image href="bg_01.png" />
</symbol>

Best Answer
0 Votes
6 REPLIES 6

Having the same issue and can't find the solution. Was hoping someone would have given the answer...

Best Answer
0 Votes

If nothing else works, you could call .animate() from your .js. You'll also need to set up the plumbing to detect the touch/click/mouse event.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

How would I set it up to detect touch/click/mouse event? Graphics I'm awesome at coding, not at all. I'm learning this on the fly. 

 

my index.j

import * as document from "document";

const dobbyAnimation = document.getElementById("dobbyAnimation");

dobbyAnimation.animate("click");

 

widgets.gui
<symbol id="frames" href="#sprite-image">
<animate id="anim" attributeName="value" begin="click"
from="01" to="40" dur="2.5" />
<image href="dobby_01.png" width="300" height="300" />
</symbol>

 

It does nothing. If I switch click to enable and add repeat duration/count it works and plays perfectly. I would rather it play on click. 

 

Idealistically I would like 3 different animations that it cycles through on click but one step at a time... I'm trying to make my own version of the toystory apple watch face but with harry potter...

Best Answer
Best Answer

THANK YOU! Took me forever where to put the pointer-events="visible" because I don't have a .view file but I got it!! In my index.gui, Thanks for pointing me in the right direction!! I've been working hours on this one tiny thing!!!

Best Answer

Fabulous; well done! pointer-events is a common gotcha, and the old documentation doesn't help.

The satisfaction of overcoming hurdles like this makes the pain worthwhile — sometimes.

I was half-expecting criticism for being vague. 🙂

Peter McLennan
Gondwana Software
Best Answer
0 Votes