In terms of being able to do something like that declaratively, it seems like 
the question has come up before, but I honestly can't remember if someone 
suggested a solution that would actually work anywhere -- I rather doubt it -- 
something like

<text id="5" x="0" y="240" font-family="Verdana" font-size="55"
fill="red">5
 <animate DOMValue="firstChild.nodeValue" 
 values="5;4;3;2;1"  dur="5s" /></text>

would be sorta cool, but probably not at all consistent with any reading of the 
specs.

In the meantime, a script which changes the values, countdown style, is as 
follows. It seems to work in the versions of Opera, Safari, IE/ASV and FF that 
I have installed.

The way you have done it with <set> is an interesting way to avoid script. Your 
suggestion of moving rectangles also suggests the following:
build a text object with the digits 5,4,3,2,1 written on it. Move it under a 
window (a clipPath or a path with a hole in it), one second at a time.

The class of things that could be done in a properly plump declarative 
environment would seem to be large, but I'm not sure if the set of tools we 
have at present is quite as plump as it might ultimately need to be.

David

------------------------------
<svg  xmlns="http://www.w3.org/2000/svg";
onload="f()">
<script>
count=12
function f(){
         document.getElementById("5").firstChild.nodeValue=count--
   window.setTimeout("f()", 1000)
}
</script>
<text id="5" x="0" y="240" font-family="Verdana" font-size="55"
fill="red">5
</text>
</svg>
  ----- Original Message ----- 
  From: Rémi 
  To: svg-developers@yahoogroups.com 
  Sent: Sunday, December 09, 2007 3:22 PM
  Subject: [svg-developers] Re: SVG countdown


  Le Sun, 09 Dec 2007 13:08:46 -0600, G. Wade Johnson a écrit :

  > On Sun, 09 Dec 2007 17:38:54 -0000
  > "boulle_remi" <[EMAIL PROTECTED]> wrote:
  > 
  >> Hi,
  >> 
  >> I wrote a simple SVG countdown. You can read it above. It is okay from
  >> 5s to 0s, but the higher I start, the longer the code is...
  >> Is there a way, in SVG, to do that much more shorter than defining a
  >> text element for each number ?
  >> Thanks.
  >> Rémi
  > 
  > If you are willing to use scripting, you can just update the value of a
  > single text element every second instead of displaying multiple text
  > elements in succession.

  I did that first but the time in javascript doesn't seem to be exactly 
  the same than the one in the SVG document (rendering engine of Opera).

  In my case, I had, next to the countdown from 5s to 0s, a rectangle whose 
  width was moving from 0 to 100 within 5s. Here is the code :

  <rect x="0" y="100" width="10" height="20" stroke="black" fill="red">
  <animate attributeName='width' begin='0s' dur='5s' from='0' to='500' 
  fill="freeze"/>
  </rect>
  and 5 s in javascript are not 5s in SVG document... When the rectangle 
  freezed, the javacsript countdown wasn't at 0.

  It is the reason why I was wondering if there were a possibility in SVG 
  to have a kind of repetition of an animation with an incrementation.

  Thanks.
  Rémi.



   

[Non-text portions of this message have been removed]



-----
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/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/svg-developers/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> 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