Hi,

> 
> This following code throws a "null" error in Batik, though for the 
> life of me I don't know why:
>                       

By "null" error, do you mean a null pointer exception?
I see two things in the code which aren't very clean. But I don't 
know if they would cause an error in Batik, or what type of error 
that would be.

One thing is that the code doesn't use the namespace aware method 
setAttributeNS.
The other is that 'waveLength' and 'newOffset' are numbers. I would 
write the setAttribute calls as

waveText.setAttributeNS(null, 'startOffset', ''+newOffset);

Adding the number to an empty string to make sure it is converted to 
a string. Maybe Batik doesn't like the wrong type in the method call, 
although "null exception" doesn't really sound like this was the 
problem.

>        var wavePath, waveLength, waveText;
>                                
>      function Initialize(){
>               wavePath = document.getElementById('wavePath');
>               waveLength = wavePath.getTotalLength();
>               waveText = document.getElementById('waveText');
>               waveText.setAttribute('startOffset', waveLength);
>               moveText();
>           }
>                                       
>        function moveText(){
>               var currentOffset = parseInt(waveText.getAttribute
> ('startOffset'));
>               var newOffset = (currentOffset < -waveLength)? 
> waveLength: currentOffset - 5;
>               waveText.setAttribute('startOffset', newOffset);
>               setTimeout('moveText()', 100);
>               }
> 

> 
> I have also learned:
>     *Fills and gradients don't animate too well in Batik, using 
> either declarative or script animation,
>     *Batik doesn't comprende event listeners to well,
>     *and how Batik renders this animation is just weird:      
> 
>       <svg width="1000px" height="600px">
>       
>               <defs>
>               </defs>
>          <!-- Animation renders properly in ASV but not in Batik -->
>                <path d="M200 200 l200 0 0 200 -200 0 z" fill="none" 
> stroke="black" stroke-width="4"/>
>                <g fill="none" stroke="red" stroke-width="7" 
> transform="translate(200, 200)">
>                       <animateMotion path="M0 0 l200 0 0 200 -200 0 
> z" begin="2s" dur="8s" repeatCount="indefinite" rotate="auto" />
>                       <line x1="0" y1="0" x2="50" y2="0"/>
>                       <line x1="50" y1="" x2="35" y2="-15"/>
>                       <line x1="50" y1="" x2="35" y2="15"/>
>               </g>
>               
>       </svg>
>       

Yes, this looks weird in Batik. Without the rotate="auto", Batik does 
fine. It seems like the rotation matrix is multiplied at the wrong 
side or something like that. This definitely is a bug. Someone here 
who can tell if it's a known one?

> In short, I figure the closer to ECMAScript I stick--and the less I 
> rely on things like event listeners the more likely my code is to 
> work cross-platform.
> 

Yep. Always stick to the specs !
About event listeners: I wasn't quite aware of it, but now that you 
mention it, event listeners really are a source of trouble with 
current implementations, aren't they.


Bye,

  Frank




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