Oh yes, I am sorry, thank you for aclaring this, in fact I found by 
myself some of the mistakes, but even that i corrected the syntax 
mistakes, I can not find the correct SVG code for make the correct 
animation..., this is the new code, and even that i can see some of 
the code i want, it still don't runs properly clicking the throw 
button.

I know that is my project, I know that I am only an student and I am 
still learning this, that is why I am asking for advices.

Thank you very much.

Travsam.

<?xml version="1.0"?>


<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 
1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd";>
<svg width="1000px" height="1000px" viewBox="0 0 1000 1000">
<script language="text/ecmasscript">
<![CDATA[
/**   Configures the dice according to a six number's random select.
      It should change the visibility status of one SVG object 
forming dice forms.
      The default number is 1, the visibility will change depending 
of the number.
*/

function throwDice(){

var randomDice=Math.round(Math.random()*5);
dice = randomDice;

switch ( dice )
{
        
        case 1: 
                var d2 = svgDocument.getElementbyId("d2");
                d2.setAttribute( "visibility", visStatus );
                break;
        case 2: 
                var d3 = svgDocument.getElementbyId("d3");
                d3.setAttribute( "visibility", visStatus );
                break;
        case 3: 
                var d4 = svgDocument.getElementbyId("d4");
                d4.setAttribute( "visibility", visStatus );
                break;
        case 4: 
                var d5 = svgDocument.getElementbyId("d5");
                d5.setAttribute( "visibility", visStatus );
                break;
        case 5: 
                var d6 = svgDocument.getElementbyId("d6");
                d6.setAttribute( "visibility", visStatus );
                break;
        default:
                var d1 = svgDocument.getElementbyId("d1");
                d1.setAttribute( "visibility", visStatus );
                
}

}

]]>

</script>
<!-- creating the dice pictures that had to match with the value of 
the random number-->
                
        <g id="d1" visibility="visible">
        <circle cx="100" cy="100" r="10" style="fill: blue;"/>
        </g>
        <g id="d2" visibility="hidden">
        <circle cx="125" cy="125" r="10" style="fill: blue;"/>
        <circle cx="75" cy="75" r="10" style="fill: blue;"/>
        </g>
        <g id="d3" visibility="hidden">
        <circle cx="125" cy="125" r="10" style="fill: blue;"/>
        <circle cx="75" cy="75" r="10" style="fill: blue;"/>
        <circle cx="100" cy="100" r="10" style="fill: blue;"/>
        </g>
        <g id="d4" visibility="hidden">
        <circle cx="125" cy="125" r="10" style="fill: blue;"/>
        <circle cx="75" cy="75" r="10" style="fill: blue;"/>
        <circle cx="125" cy="75" r="10" style="fill: blue;"/>
        <circle cx="75" cy="125" r="10" style="fill: blue;"/>
        </g>
        <g id="d5" visibility="hidden">
        <circle cx="125" cy="125" r="10" style="fill: blue;"/>
        <circle cx="75" cy="75" r="10" style="fill: blue;"/>
        <circle cx="125" cy="75" r="10" style="fill: blue;"/>
        <circle cx="75" cy="125" r="10" style="fill: blue;"/>
        <circle cx="100" cy="100" r="10" style="fill: blue;"/>
        </g>
        <g id="d6" visibility="hidden">
        <circle cx="125" cy="125" r="10" style="fill: blue;"/>
        <circle cx="75" cy="75" r="10" style="fill: blue;"/>
        <circle cx="125" cy="75" r="10" style="fill: blue;"/>
        <circle cx="75" cy="125" r="10" style="fill: blue;"/>
        <circle cx="75" cy="100" r="10" style="fill: blue;"/>
        <circle cx="125" cy="100" r="10" style="fill: blue;"/>
        </g>
        
<!--creating the button Throw-->
        <g onclick="throwDice();">
        <rect x="70" y="10" width="60" height="20" rx="4" ry="4" 
style="fill: #ddd;"/>
        <text x="100" y="25" style="text-anchor: 
middle;">Throw</text>
        </g>
<!--creating the square that involves the dice-->
        <rect x="50" y="50" height="100" width="100" style="fill: 
none; stroke: black;"/>
</svg>






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