views:

66

answers:

1

I would like programmatic access to the ActionScript I have on frames within Flash source files.

We have hundreds of flash files, each representing "lessons", and each frame within each lesson represents a "page" in an instructional book. So there are thousands of pages, each of which have scripts that play animations and other things. I'd like programmatic access to those individual scripts, so that I can parse them and enumerate which animations are being played among other things.

I thought about pulling out the scripts on each frame into text files, and just using an #include statement, but that's a lot of work, and it creates additional files and associative links that need to be maintained between the file and the #include statements on each page, so I'm not going to do that. I thinks its best to keep the scripts in the Flash source files, and find a way to access them via code.

I think in general we need more .NET API's for programmatic access to all kinds of files, information, and software; we [programmers] could do so many more interesting things with the software and files we already use.

+3  A: 

The FLA format is fully proprietary. However, some folks have figured out how to work with it. From what I understand it's a straight dump of all of the objects from the IDE.

If you want to code against a FLA, the most straightforward method would be to use JSFL - it's just Javascript for controlling the Flash IDE. You can either launch Flash with the JSFL file as an argument or open and run scripts from within the IDE (the Commands menu). In addition, you can create custom panels for the Flash IDE that can communicate with your JSFL scripts. This is handy for creating UIs for your scripts.

JSFL is a straight JS representation of the IDE, so it can be very unintuitive at time. You'll just want to make sure to read through the Extending Flash documentation that Adobe provides.

Branden Hall