Bug when adding a sprite to 1 <s:State>
- by lostincode
I'm working within a skin for a button that has some <s:State> normal over
In the tag, I'm drawing a circle
private var theshape:Sprite;
private function drawShape():void {
theshape = new Sprite();
theshape.graphics.beginFill(0x666666);
theshape.graphics.drawCircle(3,5,10);
theshape.graphics.endFill();
//i then add it to a Spite Visual Element that's defined in mxml
canv.addChild(theshape);
}
This works fine, until I try to control under which states that canv SpriteVisualElement appears. If I just add an includeIn like this
<s:SpriteVisualElement id="canv" includeIn="over" />
I get a run-time error TypeError: Error #1009: Cannot access a property or method of a null object reference.
Any ideas what the problem is, or a different way I can accomplish the same thing. What I need is to simply include the circle in the button when it's in the hover state.