My actionscript:
package
{
import flash.display.Graphics;
import flash.display.Sprite;
import flash.events.Event;
import spark.core.SpriteVisualElement;
public class SimpleFill extends SpriteVisualElement
{
public function SimpleFill()
{
//var sprite:Sprite = new Sprite();
//var graphics:Graphics = sprite.graphics;
graphics.beginFill(0x0000FF, 1);
graphics.drawRect(10, 10, width, height);
graphics.endFill();
//addChild(sprite);
}
}
}
I also tried with the commented lines uncommented, but does not work either.
My MXML:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="640" minHeight="480"
creationComplete="initApp()">
<fx:Script>
<![CDATA[
public function initApp():void
{
addElement(new SimpleFill());
}
]]>
</fx:Script>
</s:Application>
any idea why it isn't drawing?