« Five3D
» AS4 naming conventions

AS3, Flash

AS2 legacy hell; possible salvation in an AS3 Façade … but how?

05.06.08 | Comment?

At my work, we have to maintain a large and utterly horrible legacy project. You know the type. AS2, and not just any AS2 … nasty _global-infested, _root-ridden, procedural … like spaghetti when you forget to put a drop of olive oil in the water: tangled and stuck together. It’s far too big to redevelop the whole thing from scratch.

There are some small saving graces to this situation. It’s broken up into a “shell” SWF that loads in “component” SWFs (nothing to do with components in the Adobe sense, just SWFs that get loaded in, and follow an implicit interface - i.e. they all have an init() method). So in that sense, although there are a lot of dependencies, it should be possible to track them all down. My thought is that we replace the shell with a more maintainable set of AS3 objects, and provide an AS2 façade that manages all the legacy hideousness; to the components, everything is the same, but under the hood, it’s totally different.

I had a look at Grant Skinner’s SWFBridge and JumpEyeComponents’ ActionScript Bridge. Both provide a way of allowing AS2 and AS3 to talk to each other. With both, unfortunately, the communication is asynchronous; they use LocalConnection. That won’t fly in this scenario, without rewriting the components to listen for events and so on. There are too many components for that to be a realistic plan.

Does anyone know of a method to get AVM1 and AVM2 to talk to each other synchronously? A commentor on Grant Skinner’s blog post mentioned a project called “ASBridge” that does exactly that - using ExternalInterface as the underlying transport mechanism - but it doesn’t look like he’s released it.

related

have your say

Add your comment below, or trackback from your own site. Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

:

:


« Five3D
» AS4 naming conventions
Close
E-mail It