Well proved me wrong!  I was always told you couldn't but from this
tutorial I am obviously mistaken.

http://www.kevlindev.com/tutorials/basics/animation/js_dom_smil/

Got me there Holger. :)

Alastair

--- In [email protected], Holger Will <[EMAIL PROTECTED]> wrote:
> Hi Peter
> Real, Peter schrieb:
> 
> > Hello Alastair,
> >
> > Yes, I would like to trigger a SMIL animation with a JavaScript
custom 
> > event. Animations can be started by a fixed timestamp or an event. 
> > Normally the events are raised by user actions. Is there a way to 
> > create a custom event, so that the programmer can start the animation 
> > when ever he likes?
> 
> there are five methods to controll  SMIL animations via script on 
> document level see  http://www.web-zaehler.de/svgcafe/viewtopic?t=315
> and four methods on element level:
> 
> beginElement()
> endElement()
> beginElementAT()
> endElementAT()
> 
> to use these methods, you have to set begin/end of your animate
elements 
> to indefinite.
> see: http://www.w3.org/TR/SVG/animate.html#DOMInterfaces
> example:
> 
> <?xml version="1.0"?>
> <svg xmlns="http://www.w3.org/2000/svg";
>  xmlns:xlink="http://www.w3.org/1999/xlink"; viewBox="0 0 1024 768" >
>   <rect x="0" y="0" width="100" height="100" onclick="startAnimation()">
>   <animate id="anim1" attributeName="x" from="0" to="50" 
> begin="indefinite" dur="2s"/>
>   </rect>
> 
> <script>
> function startAnimation(){
> document.getElementById("anim1").beginElement()
> }
> </script>
> </svg>
> 
> hth
> Holger




-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to