HaxeFlixel/flixel — pull request #948 by MSGhero (2014-03-20 18:38:26+00:00)
Title: ~committed to dev~

@Gama11 @gamedevsam

Fixes #943

Updated to dev version.

I can't see `remove` ever being necessary when you could create a new animation instead. Even still, adding `remove` methods would just be replacing `push()` with `splice()` and `indexOf()` in the `append` code.

If the redundant code is an issue, there can be private helper methods which contain all the shared code. They would take an input array and push to it (`add` would give an empty array, `append` would give the existing one).

`Append` is useful when the frames in your atlas have different prefixes. For me, swfs with frame labels put into TexturePacker look like

```
atk/slash_0000
atk/slash_0001
...
atk/windup_0000
atk/windup_0001
...
```

`addByPrefix` would be fine here except "windup" should come before "slash," but "slash" comes first alphabetically and gets placed first. Code goes from

```
var arr = Lambda.array(Lambda.concat([for (i in 0...19) "atk/windup_00" + (i < 10 ? "0" : "") + i], [for (i in 0...7) "atk/slash_00" + (i < 10 ? "0" : "") + i]));
addByNames("atk", arr); // this is the concise version
```

to

```
addByPrefix("atk", "atk/windup_");
appendByPrefix("atk", "atk/slash_");
```