Touble with animation [Archive] - XML Elves

Touble with animation

seb
08-09-2004, 01:08 AM
Hello everyone,

This week-end i decided to change my zoom functions + and - to progessive zoom. Therefore i apllied to those two functions an animation that changes the value of my viewBox. Besides the animation i am still changing via setAttribute the value of my viewBox. Everything is working fine, except that now i am not abble to use some others functions that are supposed to change my viewBox. I have to use the animation in order for them to work. Is that a known problem or am i doing anything wrong?

Thanks in advance, seb.

Anonymous
08-09-2004, 03:48 AM
More datails please ...

Michel

Anonymous
08-09-2004, 04:17 AM
My svg:

<svg id="couches" vb="0" x="0" y="0" width='700' height='600' zoomfactor="2" panfactor="100" viewBox="" o_x="" o_y="" o_width="" o_height="" visibility="visible">

<animate id="motion" attributeName="viewBox" attributeType="XML" begin="s" dur="2s" values="" repeatCount="1" fill="freeze"/>

</svg>

My function ZoomOut():

function ZoomOut()
{
View();//return the value of the initial viewBox
zoomfactor=innersvg.getAttribute("zoomfactor");

vbw*=zoomfactor;
vbh*=zoomfactor;
vbx = midx - (vbw/2);
vby = midy - (vbh/2);

New_vb=vbx+" "+vby+" "+vbw+" "+vbh;

motion.setAttribute('values', vb + ';' + New_vb);
motion.beginElement();

innersvg.setAttribute("viewBox",New_vb);
}

All of this is working fine, but if i do an other function like for example:

function ChangeViewBox()
{
innersvg.setAttribute("viewBox","1000 1000 500 500");

}

this is working as long as i did not call the function ZoomOut(). As soon as i used the animation once, i can not use the function ChangeViewBox() anymore.

Hope it is clear enough this time, :D seb.

Anonymous
08-09-2004, 10:03 AM
Do you try to add motion.endElement in your function ChangeViewBox() ?

Michel

Anonymous
08-10-2004, 12:15 AM
No i did not, but i am going to try.

Thanks.

Anonymous
08-10-2004, 12:37 AM
The problem was the fill of the motion that is equals to freeze. If i put fill to nothing everything is working just fine.

Seb.

 
Web mp2kmag.com
mapforums.com

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum