PrimaryFeather/Starling-Framework — Issue #62: override addChildAt causes infinite ADDED event
Author: volzh
Created: 2012-01-17 06:15:44+00:00
State: open

I want to extends Sprite class.
so, I tried like below.
then ADDED event is fired inifinitely.

```as
package
{
import starling.display.Sprite;

public class Main extends Sprite
{
public function Main()
{
super();

var sp:Sprite2 = new Sprite2();
}
}
}
import starling.display.DisplayObject;
import starling.display.Sprite;

class Sprite2 extends Sprite
{
private var _content:Sprite = new Sprite();

function Sprite2()
{
super();

this.addChild(this._content);
}

public override function addChild(child:DisplayObject):void
{
this._content.addChild(child);
}

public override function addChildAt(child:DisplayObject, index:int):void
{
this._content.addChildAt(child, index);
}
}
```

if don't override addChildAt function, it's fine.