xJSFL - makes working with Flash IDE assets tolerable

Submitted by hc on Wed, 2012-05-16 10:49
hc's picture

I'm working on a project with an animator friend. Being an animator, the Flash IDE is the place where he does all his work. Fair enough, I can accept that, but it makes my life as the coder in this project no fun. Squiilions of assets, and a brief that requires the end result of his animation efforts to be completely skinnable by the end user, means that I was searching for something to make asset wrangling painless.

I started with the built in JSFL scripting system. It's pretty rubbish. Lots of code required to do some pretty simple things (iterate library items, iterate timelines etc). I was Googling around looking for other possibilities when I came across xJSFL (buried in the results, its not #1 if you type jsfl into a search, but it should be). Dave Stewart, its creator, has single-handedly crafted an extremely flexible, elegant framework over the top of JSFL, adding jQuery-style selectors, and iterators to allow *much* easier traversal of fla files' contents. It's also got some very powerful templating systems in it, that allow the easy writing out of templated classes, XML congif files etc.

For this project, Al can create animation sequences, skin clips, and tintable clips for asset, give them any alphanumeric name within reason, and so long as he places them in the correct library folder, he can then run my xJSFL script to:

  • assign CamelCase linkage ids
  • add the exported clases to an uber include doc, ensuring they are picked up by the compiler from an swc
  • put them in a heirarchical xml config, to drive runtime UI choices
  • check whether the linked class IDs onstage already exist as classes on disk, and modify linkage ids accordingly - this allows me to have some assets have code 'smarts' in them, while the majority are just 'dumb' skins
He can then publish a test fla in the IDE which allows him to test animation sequences & skins in realtime. When time comes to build the app, I will be able to pull in an SWC of assets into my coding environment of choice (Eclipse / FDT).

Project specific lbraries of xJSFL snippets can be stored anywhere, which means I can pass updated xJSFL functionality to him when he does a git pull of the project. All up, it's a really elegant workflow solution, and I think he's wept more than the occasional tear of joy as he tests an animation / skin combination without having to manually swap in / out sets of movieclips... ouch.

The framework's not complete yet, and the docs vs code are a bit out of whack, but it is still gold. Spend a few hours with it, and watch your productivity take a leap forwards. I'll share a sample movie when things have been released, in late June.

Drupal theme by Kiwi Themes.