我正在尝试使用actionscript3
绘制一系列矩形。我使用XML
<onlineTrain>
<sensor>
<xlocation>13</xlocation>
<ylocation>307</ylocation>
</sensor>
<sensor>
<xlocation>121</xlocation>
<ylocation>301/ylocation>
</sensor>
</onlineTrain>
所以我将这些值放在foreach
:
for each(var element:XML in xml.sensor)
{
var sp:Sprite = new Sprite();
addChild(sp);
sp.x =element.xlocation;
sp.y = element.ylocation;
var g:Graphics = sp.graphics;
g.lineStyle(1, 0x0000FF);
g.drawRoundRect(0, 0, 100, 60, 15);
}
但它没有用。任何想法都会受到赞赏。我是AS3中的新人
答案 0 :(得分:0)