> For the complete documentation index, see [llms.txt](https://docs.flatredball.com/flatredball/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flatredball.com/flatredball/api/flatredball/content/animationchain/flatredball-content-animationchainlistsave.md).

# AnimationChainListSave

### Introduction

AnimationChainListSaves are the ["save"](https://github.com/flatredball/FlatRedBallDocs/blob/main/frb/docs/index.php) object type for [AnimationChainLists](https://github.com/flatredball/FlatRedBallDocs/blob/main/frb/docs/index.php). AnimatiohChainListSaves can be used to create and load .achx files. For general information on common FlatRedBall types, see the [FlatRedBall File Types](https://github.com/flatredball/FlatRedBallDocs/blob/main/frb/docs/index.php) wiki entry.

The AnimationChainListSave class is a standardized way to save an [AnimationChainList](https://github.com/flatredball/FlatRedBallDocs/blob/main/frb/docs/index.php). Using the AnimationChainListSave class has the following benefits:

1. Requires very little code to use
2. Resulting files are 100% compatible with the FRBDK or any other application that can load .achx files.

### Loading a .achx file

You can load load a AnimationChainListSave as follows:

```
AnimationChainListSave saveInstance = AnimationChainListSave.FromFile("fileName.achx");
```

### Saving a .achx file

The following code saves a .achx file named MyAnimationChainList.achx. It assumes that animationChainList is a valid [AnimationChainList](https://github.com/flatredball/FlatRedBallDocs/blob/main/frb/docs/index.php).

Add the following using statements:

```
using FlatRedBall.Content.AnimationChain;
using FlatRedBall.Graphics.Animation;
```

Assumes animationChainList is a valid AnimationChainList:

```
 AnimationChainListSave save =
    AnimationChainListSave.FromAnimationChainList(animationChainList);
 string fileName = "MyAnimationChainList.achx";
 save.Save(fileName);
```

#### Saving a loaded AnimationChainListSave

Of course, you can save a loaded AnimationChainListSave:

```
string fileName = "fileName.achx";
// load it
AnimationChainListSave saveInstance = AnimationChainListSave.FromFile(fileName);
// and save it
saveInstance.Save(fileName);
```

Of course, the code above does nothing; however, you can do things to the saveInstance between the load and save calls:

```
 string fileName = "fileName.achx";
// load it
AnimationChainListSave saveInstance = AnimationChainListSave.FromFile(fileName);
foreach(AnimationChainSave chainSave in saveInstance.AnimationChains)
{
   // Do whatever to the chainSave
   // You can even loop through the frames:
   foreach(AnimationFrameSave frameSave in chainSave.Frames)
   {
       // do whatever you want to frames
   }
}
// and save it
saveInstance.Save(fileName);
```

In fact, you can do pretty much anything to an AnimationChainListSave instance and it will result in a valid .achx file when saving it out. This enables you to easily create tools to create and modify .achx files.

Did this article leave any questions unanswered? Post any question in our [forums](https://github.com/flatredball/FlatRedBallDocs/blob/main/frb/forum.md) for a rapid response.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.flatredball.com/flatredball/api/flatredball/content/animationchain/flatredball-content-animationchainlistsave.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
