Actionscript 3 svg XML parsing bug?
Posted
by
Mahir
on Stack Overflow
See other posts from Stack Overflow
or by Mahir
Published on 2011-01-11T06:52:18Z
Indexed on
2011/01/11
7:53 UTC
Read the original article
Hit count: 238
Hey I get two different results when using the for each loop below.
As far as I can tell there's no difference aside from attributes in the two XML literals.
for each (var pathXML:XML in svg.path)
{
// do stuff... trace(pathXML.@stroke)
}
// This one works, the loop iterates once over the single path element...
var svg:XML =
<svg>
<path stroke="#00FF00" />
</svg>
// This one doesn't, the loop just exits.
var svg:XML =
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="612px" height="792px" viewBox="0 0 612 792" enable-background="new 0 0 612 792" xml:space="preserve">
<path fill="#FFFFFF" stroke="#000000" d="M160.333,372.444c0,0,17.778-115.555,60-63.333s27.778-106.666,78.889,40" />
</svg>
© Stack Overflow or respective owner