Cameron McCormack wrote: > e2mieluv: >> i do hope you guys could help me with this. Kevin's path parser is >> really useful in extracting multiple path.however,i'm finding >> difficulty to extract the path that has been retrieve by the path >> parser into 1 points. >> >> in the example it uses tspan which to manipulate text and 1 more thing >> i forgot. but how to extract the path? >> >> ex. path extracted M a,b L c,d >> would like to extract it as point a,b to be save in an array. >> anyone knows how the path parser could work that way? please help me, > > Why don't you use the SVG DOM interfaces? They provide access to the > individual path commands from an SVG path element. Have a look at > http://www.w3.org/TR/SVG11/paths.html#DOMInterfaces, where you can see > that you can use the pathSegList attribute (which is of type > SVGAnimatedPathData). Something like: > > var pathElement = ...; > var pathSegList = pathElement.pathSegList; > for (var i = 0; i < pathSegList.numberOfItems; i++) { > var pathSeg = pathSegList.getItem(i); > // do something with the pathSeg > }
The reason why I recommend using Kevin Lindsey's path parser is that I didn't knew this interface (plus it can do more, like splitting paths or firing events). The reason why I will continue to recommend using it is that ASV3 doesn't seems to support this interface. It isn't listed in the Current Support document, and trying your code, I get null for pathSegList... Too bad, it was interesting. e2mieluv, I will take a look at your problem, but I have no more time right now, more later. -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- For servers mangling my From and Reply-To fields, -- please send private answers to PhiLho(a)GMX.net -- -- -- -- -- -- -- -- -- -- -- -- -- -- ----- 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/

