---
name: "open_fli"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.2-2.2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/open_fli"
---

# open\_fli(3alleg)

Makes a FLI file open and ready for playing. Allegro game programming library.

## NAME

open\_fli, open\_memory\_fli - Makes a FLI file open and ready for playing. Allegro game programming library.

## SYNOPSIS

**#include \<allegro.h\>**

**int open\_fli(const char \*filename);**

**int open\_memory\_fli(const void \*fli\_data);**

## DESCRIPTION

Open FLI files ready for playing, reading the data from disk or memory respectively. Information about the current FLI is held in the global variables fli\_bitmap and fli\_palette, which you can use if this function succeeds. However, you can only have one animation open at a time. Example:

```
   if (open_fli("intro.fli") == FLI_ERROR)
      abort_on_error("Error playing intro");
```

## RETURN VALUE

Returns FLI\_OK on success, FLI\_ERROR if something went wrong, like trying to open another FLI file without closing the previous one.

## SEE ALSO

[**close\_fli**(3alleg)](/close_fli/3alleg.md), [**next\_fli\_frame**(3alleg)](/next_fli_frame/3alleg.md), [**fli\_bitmap**(3alleg)](/fli_bitmap/3alleg.md), [**fli\_palette**(3alleg)](/fli_palette/3alleg.md)
