Actionscript 3 svg XML parsing bug?
- by Mahir
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>