Question: I have a question about if a animation ends that it will like `gotoAndStop()` to another frame

```
if (bird.hitTestObject(pipe1)) {

     bird.gotoAndStop(3); //frame 3 = animation

}

```

after it ends it will need to go the Game Over frame (frame 3) and I use the `Flash Timeline` not `.as` thanks!

Answer: 
Java does not provide a convenient way to list the "files" in a "directory", when that directory is backed by a JAR file on the classpath (see [How do I list the files inside a JAR file?](https://stackoverflow.com/questions/1429172/how-do-i-list-the-files-inside-a-jar-file) for some work-arounds). I believe this is because the general case where a "directory" exists in multiple .jar files and classpath directories is really complicated (the system would have to present a union of entries across multiple sources and deal with overlaps).

Because Java/Android do not have clean support this, neither does Libgdx (searching the classpath is what "internal" Libgdx files map to).

I think the easiest way to work-around this is to build a list of levels into a text file, then open that and use it as a list of file names. So, something like:

```
// XXX More pseudo code in Java than actual code ... (this is untested)
fileList = Gdx.files.internal("levels.txt");
String files[] = fileList.readString().split("\\n");
for (String filename: files) {
   FileHandle fh = Gdx.files.internal("levels/" + filename);
   ...
}

```

Ideally you'd set something up that builds this text file when the JAR file is built. (That's a separate SO question I don't know the answer to ...)

As an aside, your work-around that uses `ApplicationType.Desktop` is leveraging the fact that in addition to the .jar file, there is a real directory on the classpath that you can open. That directory doesn't exist on the Android device (it actually only exists on the desktop when running under your build environment).
If you are still looking for an actual answer here is [mine](https://pastebin.com/R0jMh4ui) (it is kinda hacky but its work). 

To use it you simply have to call one of the 2 options below : 

```
FileHandle[] fileList = JarUtils.listFromJarIfNecessary("Path/to/your/folder");
FileHandle[] fileList = JarUtils.listFromJarIfNecessary(yourJarFileFilter);

```

A JarFileFilter is a simple class that overload the Java default FileFilter to fits the jar filter needs.

This will work both: when running from the IDE and from within a jar file. It also check that the game is running on desktop otherwise it use the default libGDX way of loadding the resources so it is safe to use for cross-platform project (Android, Ios, etc.).  

Feel free to update the code if necessary to fit your needs. The code is documented and is ~150 lines so hopefully you will understand it.

Warning: Beware that this might not be very efficient since it has to look for all the entries within your jar so you do not want to call it too often.