ÿþ<html><title>Javascript SVG/XML DOM Example: getCTM</title> <body onload="run_getCTM();sendScript()"> <B>Javascript SVG/XML DOM Example: getCTM</B> <br />Note:This is the source file for this example. To view this example <a href="http://www.mobiusPortal.com/">Click here</a></body> <script> function checkOpener() { if(parent.location.href.indexOf("mobius")==-1) window.location.href="http://www.mobiusPortal.com/" } //---expose parent global vars to this document--- var Godfather=parent.Godfather var Hood=parent.Hood var Shifty=parent.Shifty var Smiley=parent.Smiley var Rosie=parent.Rosie var sourceValue=parent.sourceValue var scriptBlockValue=parent.scriptBlockValue var Apartment=parent.Apartment var CharactersText=parent.CharactersText var WhazHappenen=parent.WhazHappenen var printNode=parent.printNode var parseXML=parent.parseXML function sendScript() { scriptBlockValue.value=myScript.text //---display in textarea--- sourceValue.value=printNode(Shifty) parent.exampleTitleSpan.innerHTML="<b class=large>getCTM</b>" } </script> <script id=myScript> function run_getCTM() { var shiftyCTM=Shifty.getCTM() var a=shiftyCTM.a//---Cos of relative angle var b=shiftyCTM.b//---Sin of relative angle var c=shiftyCTM.c//---(minus)Sin of relative angle var d=shiftyCTM.d//---Cos of relative angle var e=shiftyCTM.e//---translation x var f=shiftyCTM.f//---translation y var matrixString="matrix("+a+" "+b+" "+c+" "+d+" "+e+" "+f+")" CharactersText.firstChild.setData(matrixString) //---use the matrix to 'shift' Shifty--- setCTM(Shifty,.7,.03,-.03,.7,e,f) } function setCTM(myElem,a,b,c,d,e,f) { myElem.setAttribute("transform","matrix("+a+" "+b+" "+c+" "+d+" "+e+" "+f+")") } </script> <script> //---expose local vars to parent--- //---parent.xyz=xyz--- </script> </html>