Good, I had just opened up my code to see what it was doing. The use of stroke twice (once for the color of the stroke and once as id) was simply a convenient way of giving each object a unique id (I assumed the probability of having two 24 bit random integers being the same was negigible). I used the id for figuring out which object to drag, but in this case evt.target could easily have been used for the same purpose. I will simplify my code when I get the chance.
Glad you got it working! David ----- Original Message ----- From: takpoli To: [email protected] Sent: Monday, July 14, 2008 5:33 PM Subject: [svg-developers] Re: spring framework David, You may igore last email. I got it working: width:20, height:30, x:evt.clientX, y:evt.clientY, in attribute and o.setAttributeNS(null, "x", evt.clientX) o.setAttributeNS(null, "y", evt.clientY) in slide Thanks, Tak --- In [email protected], "takpoli" <[EMAIL PROTECTED]> wrote: > > > Hi David, > > I would like to change circles in your code to rect. I did the > following: > > 1. I change the backgroud from rect to polygon and it works. > > 2. I change the circle to rect by > a. change "circle" to "rect" > b. change "r:rad" to > "x:20", > "y:30" in the Atribute assignment > > However, this will be work for me. What is wrong with my > modification? > > By the way, what is the meaning of "id":stroke in your code? Why we > need to do that? > > Thank you for your help. > > Tak > > > > > > > --- In [email protected], "ddailey" <ddailey@> wrote: > > > > Hi Tak, > > > > you wrote: "If the user creates 4 circles in your page, could we > save all 4 circles (x, > > y, r, color) to a server and continue to work on his project the > next day by > > redraw those circles from the saving data? Do you happen to work > that out > > yet?" > > > > Sure we could and I think it would be fairly easy. In the source > of http://srufaculty.sru.edu/david.dailey/svg/makeDragDrop.svg , > > > > there are a couple of lines after the DOM object (the circle = C) > has been created, it is then populated with a collection of > Attributes (Attr) and appended to the SVGDOM: > > > > assignAttr(C,Attr) > > Root.appendChild(C) > > right in between there, I'd do something like this: > BigArrayofCircles.push(Attr). Then whenever the user were to choose > a "save" option (from say a menu) the BigArrayofCircles (which has > already been serialized as an Object) could just be sent (via some > format like plaintext, JSON, or AJAX -- JSON seems likely since > that's close to what it is already) to a server (which would just > scribble it into a file somehow). The clientside program would then > just need a file open routine which would pretty much just be (after > identifying the particular BigArrayofCircles, among those saved to > the server, to be opened): > > > > for (i in BigArrayofCircles) {var C=document.createElementNS > (xmlns,"circle") ;assignAttr(C,Attr)} > > > > Holler if I have not made sense. > > David > > > > > > > > > > [Non-text portions of this message have been removed] > > > [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 Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> 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/

