Inadvertently creating an ActionScript code migration tool!

I’ve had quite the nostalgic experience this week – I’m looking into re-exporting some animations I built in Flash 26 years ago! Of course these days the software is rebranded as “Adobe Animation.” However, back in the year 2000 I was using the brand new and latest of ActionScript, version 1 from the year 2000, not ActionScript 3.0, the current and much more modern version of ActionScript from the year 2006!

I had hundreds of code blocks spread throughout the animation telling different movie clips to do certain things, such as:

tellTarget ("/camera") {
gotoAndStop("5");
}

I needed this to look more like:

camera.gotoAndStop("5");

A simple find and replace was not going to work, and as I went through the file I found more and more different examples of old code that needed to be updated. A perfect candidate for a regular expression. However – Adobe Animate works well with regular expressions in the search field, but not so well in the replace field, so that wasn’t going to work.

However – Adobe Animate has the capacity to run JavaScript within the application, using something called JSFL (JavaScript Flash). With some assistance from ChatGPT I was able to create a JSFL file that updated the code to AS3.

I realised as I found and included more and more code conversion examples, that what I was creating was a code migration tool for AS1 -> AS3 – something that would have been well useful in 2006… Ah well, better 20 years late than never!

Unknown's avatar

iOS development with Swift - book: https://manning.com/books/ios-development-with-swift video course: https://www.manning.com/livevideo/ios-development-with-swift-lv

Posted in Flash

Leave a Reply

Discover more from Before I forget...

Subscribe now to keep reading and get access to the full archive.

Continue reading