Let's say I have this SVG of an insect. Unless it is otherwise impossible this way, I want to insert it as <img />
or <object />
tags.
Now, the insect.svg has two animations: one for walking and other for flying.
I'd like to start/stop these animations, individually, and from the HTML's JavaScript (or otherwise call an embed SVG JS function "walk" or "fly", from the HTML JavaScript).
So, in the end, if during the gameplay I want my insect to fly, I can just inform it to do so with JS, and tell it to stop when it shouldn't fly anymore. Same with walking.
Is there any way to do this? I've been Googling for the past hour and made no real findings. I don't care about IE support if that is an issue.
Thank you for your time!