forked from: Flex3のSprite
forked from Flex3のSprite (diff: 18)
ActionScript3 source code
/**
* Copyright sakef ( http://wonderfl.net/user/sakef )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/khj9
*/
<?xml version="1.0" encoding="utf-8"?>
<!--
forked from yoshida_surf's Flex3のSprite
rawChildrenに追加するって方法も。
sparkではないのかなこれ。
-->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="500" height="500" creationComplete="init()">
<mx:Script>
<![CDATA[
private function init():void
{
var s1:Sprite = new Sprite();
s1.graphics.beginFill(0xff0000);
s1.graphics.lineStyle(1, 0x000000);
s1.graphics.drawRect(0, 0, 300, 300);
s1.graphics.endFill();
rawChildren.addChild(s1);
var s2:Sprite = new Sprite();
s2.graphics.beginFill(0xffff00);
s2.graphics.lineStyle(1, 0x000000);
s2.graphics.drawRect(180, 180, 280, 280);
s2.graphics.endFill();
rawChildren.addChild(s2);
}
]]>
</mx:Script>
</mx:Application>