Okay, let's try it differently: Use ECMA script as the scripting language.
Patricia LaRue <[EMAIL PROTECTED]> wrote: Oops! the code didn't show up, so here it is again: from: "<script language="JavaScript">" or "<script>" to: "<script type="text/ecmascript">" Patricia LaRue <[EMAIL PROTECTED]> wrote: Peter: Wouldn't you know it....as soon as I asked for help we solved the error problem. I changed the following tag from: <script language="JavaScript"> to: <script type="text/ecmascript"> Now, I don't get any errors but the bars don't move. I'm trying to figure out if it's supposed to work using the groups to provide the hierarchies, as you said, or if I need to nest tree elements in blocks of code. If you have any further pointers it would be greatly appreciated. Thanks again, Patricia Patricia LaRue <[EMAIL PROTECTED]> wrote: Hi, Peter: I'm sorry to have to bother you about this. Perhaps you or someone else in the group can help me get this working. I've been working with this code since I received it yesterday and have tried everything I know to do with it, icluding putting alert statements in various places, but I still keep getting the following error whenever I click on the red bar: Microsoft JScript runtime error Object expected line: 1, column: 0 Any ideas of what might make this code work? Thanks a bunch, Patricia Peter Thompson <[EMAIL PROTECTED]> wrote: The following code displays a hierarchy of rectangles that can expand/collapse. You can click on a rectangle with children to hide/show the children, expanding and contracting the tree as required. The groups provide the hierarchies. I've only run it in ASVG3. <?xml version="1.0"?> <svg xmlns="http://www.w3.org/2000/svg" width='100%' height='100%' onload="init(evt)"> <g id="tasks" onmousedown="mouseClick(evt)"> <rect x="5" y="5" width="200" height="20" style="fill:blue"/> <rect x="5" y="5" width="200" height="20" style="fill:blue"/> <g> <rect x="5" y="5" width="200" height="20" style="fill:blue"/> <rect x="5" y="5" width="200" height="20" style="fill:blue"/> </g> <rect x="5" y="5" width="200" height="20" style="fill:blue"/> <rect x="5" y="5" width="200" height="20" style="fill:blue"/> <rect x="5" y="5" width="200" height="20" style="fill:yellow"/> <g> <rect x="5" y="5" width="200" height="20" style="fill:blue"/> <g> <rect x="5" y="5" width="200" height="20" style="fill:blue"/> <g> <rect x="5" y="5" width="200" height="20" style="fill:blue"/> </g> </g> </g> <rect x="5" y="5" width="200" height="20" style="fill:blue"/> <rect x="5" y="5" width="200" height="20" style="fill:red"/> </g> <script> <![CDATA[ var offsetY = 0; function init(evt) { refresh(svgDocument.getElementById("tasks") ,0); } function mouseClick(evt) { var obj=evt.target.getNextSibling(); if ((obj != null) && (obj.nodeName=="#text")) { obj=obj.getNextSibling(); if ((obj != null) && (obj.nodeName=="g")) { var attr = obj.getAttribute("visibility"); if (attr == "hidden"){ obj.setAttribute("visibility", ""); } else{ obj.setAttribute("visibility", "hidden"); } offsetY = 0; refresh(svgDocument.getElementById("tasks") ,0) } } } function refresh(objGroup, level) { var layer=objGroup.childNodes; var num=layer.length; for (var ix=0; ix < num; ix++) { var obj=layer.item(ix); if (obj.nodeName == "rect") { offsetX = level * 40; var transform = "translate(" + offsetX + " " + offsetY + ")"; obj.setAttribute("transform", transform); offsetY = offsetY + 30; } else if (obj.nodeName == "g") { if (obj.getAttribute("visibility") != "hidden"){ refresh(obj, level+1); } } } } // ]]> </script> </svg> --------------------------------- Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. [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 Sponsor Get unlimited calls to U.S./Canada --------------------------------- 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 the Yahoo! Terms of Service. [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 SponsorADVERTISEMENT --------------------------------- 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 the Yahoo! Terms of Service. [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 Sponsor Get unlimited calls to U.S./Canada --------------------------------- 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 the Yahoo! Terms of Service. [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 SponsorADVERTISEMENT --------------------------------- 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 the Yahoo! Terms of Service. [Non-text portions of this message have been removed] ------------------------ Yahoo! Groups Sponsor --------------------~--> $4.98 domain names from Yahoo!. Register anything. http://us.click.yahoo.com/Q7_YsB/neXJAA/yQLSAA/1U_rlB/TM --------------------------------------------------------------------~-> ----- 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/