Are you using edgeCommons? if yes just create a mouseleave event to restore the color using css.
The code to access the SVG files looks like the following:
But I'm still unsure of how to reset each part of the SVG.
So sorry, I've only been working with Edge Animate for about a week to 10 days.
Just add something like this in the
This is the example that I started with:
I would like to add a Reset button to get each of the selected parts back to their original color. I don't believe I can do that with the code example above.
You could store the original color in a variable (or a range of colors in an array), and then apply that variable on reset, e.g.
and then for your button:
I've not been able to get this to work. Question, if I have more than one SVG file, how does this code know which SVG document that the svgElementId is in? Or would it change all the svgElementId that have the same name?
If you assign the button click event within the section:
sym.$("mybutton").on('click',reset(svgDocument));//attach the function here
then the parameter of function(svgDocument) will give it the relevant svg to act on.
I can't get this to work in Adobe Edge Animate CC 2014. Is it a because of the version I'm using?
If you could provide a sample (to download) where this works, I'd appreciate it. Thanks.
HI Eric, can't really share them I'm afraid, they contain proprietary code. Is your version of Edge Commons compatible with your version of Animate? Could you share your example and I'll see if I can spot the problem?
That's fine. I quickly made a demo myself (using an example that I found online). You can download it here:
I'm also quite new to Edge Animate, so maybe the issue could be Edge Commons. I'm not sure.
I appreciate your help though.
Hi, I've uploaded a fixed version to Dropbox, with the superfluous stuff trimmed out.
Btw, yepnope is no longer necessary to include external js, to add Edge Commons to your project just follow the instructions here:
You can either use the CDN hosted files or download them and include the files from disk. You're also calling a function "notify" (to replace the text) that doesn't exist.
I've changed the former, but left the latter for you to sort out ;-)
This works good with the test files. However, I discovered the problem is that my actual SVG file has a group around the paths. How would I call the group entire group?
<g id="Front Panel" onclick="notify(this, "select");">
<path id="Front_Left_Panel" fill="#503277" stroke="#000000" stroke-width="0.5" d="
c18.5,8.6,26.5,20.1,32.2,37.2c5.7,17.2,10.8,57.1,11.4,88C423.9,481.8,414.5,539.8,410.5,57 6.3z M339,431.1c3,0,5.6-2.4,5.6-5.5
<path id="Right_Front_Panel" fill="#503277" stroke="#000000" stroke-width="0.5" d="