Hi Helder,
I've tried it, now my code looks like this:
// This code will be executed, when a click event appear after
everything
// was rendered (eventTarget.addEventListener("click", new
OnClickAction(),
// false))
Element parentElement = The rect which should be animated;
SVGOMAnimationElement animateElement = (SVGOMAnimationElement)
this.svgDocument.createElementNS(SVGDOMImplementation.SVG_NAMESPACE_URI,
SVG12Constants.SVG_ANIMATE_TAG);
animateElement.setAttribute("dur", "1s");
animateElement.setAttribute("values", "1; 1; 0; 0");
animateElement.setAttribute("keyTimes", "0; 0.5; 0.7; 1.0");
animateElement.setAttribute("attributeName", "opacity");
animateElement.setAttribute("attributeType", "CSS");
animateElement.setAttribute("repeatCount", "indefinite");
animateElement.setAttribute("begin", "indefinite");
parentElement.appendChild(animateElement);
if(animateElement.beginElement())
{
System.out.println("~~~~~~~~~~~~~~~~~~ Begin
animation");
}
But still it doesn't work, any other ideas?
Maybe I'll write a small test application, where you guys can also test a bit.
Regards,
Fabian
> Hi Fabian,
>
>
> > But what do I have to do, if I want to do exactly this during runtime?
> >
> > I've tried this:
> >
> >
> > SVGOMAnimationElement animate = (SVGOMAnimationElement)
> > this.svgDocument.createElementNS(SVGDOMImplementation.SVG_NAMESPACE_URI,
> > SVG12Constants.SVG_ANIMATE_TAG);
> > animate.setAttribute("dur", "1s");
> > animate.setAttribute("values", "0; 0; 1; 1");
> > animate.setAttribute("keyTimes", "0; 0.5; 0.7; 1.0");
> > animate.setAttribute("attributeName", "opacity");
> > animate.setAttribute("attributeType", "CSS");
> > animate.setAttribute("repeatCount", "indefinite");
> >
> > rect.appendChild(animate);
> >
> > animate.beginElement();
> >
> >
> > but this didn't get animated, [...]
>
> You'll need to provide a "begin" attribute set to "indefinite" in
> order to be able to trigger animations using script [1]. ;-)
>
> I'd seriously recommend diving into the SVG Primer online book (whole
> page contents in [1]) before serious SVG hacking! ;-)
>
>
> > Any help is very appreciated
> > Thanks in advance.
>
> Hope this helps,
> Helder
>
>
> [1] http://www.w3.org/Graphics/SVG/IG/resources/svgprimer.html#beginElement
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]