I solved this!!! Ater a long while tracing the process I relised that I was not removing the coords that I was trying to replace, but adding the new coords just before it
thanks to anywone that looked! Garry the solution was to take the index and shortne the points string after the loop! --- In [email protected], "Garry Haywood" <[EMAIL PROTECTED]> wrote: > Hi > > i'm trying to change a pair of points in a polygon "TAR" (6 sets, 4 > of which can be changed) > > //the new points are assigned to a string] > nuPts = (rx) + ',' + (ry); > > //the existing points are > ptsStr = document.getElementById("TAR").getAttribute("points"); > > > //set some var for looping through the ptsStr > var i=1; > var startStr='',endStr='',startSteInd=''; > > //cnt is assigned earlier via a switch to determine w > //which set of points is being replaced > // - it is never the first or last > > while (i <= cnt) > { > > window.status = 'i: ' + i > //get index of first space - assumes space is seperator > // of coords system > ind = ptsStr.indexOf(" "); > > //puts the first part into a var > startStr = startStr + ptsStr.substring(0,ind+1); > > //puts remainining into itself > ptsStr = ptsStr.substring(ind+1); > > // increase iteration > i++; > > } // loops ends when established first part of string > > //rebulid points > nuStr = startStr + nuPts + ptsStr; > > document.getElementById("display").firstChild.setData(nuStr) > > if (polyChk==1){ > document.getElementById("TAR").setAttribute("points",nuStr); > } > > if i don't have the polygon change the 'nuStr' var contains the > correct points info > > yet when I try to set the polygon, it just doesn't take the string > but seems to add the new points over and over again > > > a version of this can be a seen at > > http://svg.betamodel.com/radar1.svg > > any clues ? > > Thanks in advance > > Garry ------------------------ Yahoo! Groups Sponsor --------------------~--> Most low income households are not online. Help bridge the digital divide today! http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/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/

