views:

145

answers:

1

Can anyone recommend an AOP framework for AS3?

+1  A: 

AOP and AS3 is rather hard, because AS3 is very static at runtime. at least the sealed classes, which are the vast majority ... you could use ECMA-compatibility mode or go through proxies, all at cost of speed and with some restrictions (proxies can't mock in AS3, so you will actually need to write your code against those proxies) ...

[Bindable] metatag supported by mxmlc will help you add AOP for property access ... at least sort of. It will generate code to dispatch a PropertyChangeEvent, that you can cancel, if needed ...

i think AOP in AS3 is only possible at compiletime (ok, you could postprocess ABC after build, but i'm not sure that's the easiest way to go) ... thus you'd need a preprocessor to generate quite some code for you, modify external swcs etc. ... not too trivial ...

i know, this sounds a little weird, but AS2 is much much better for that, because all this can be easily done at runtime ... here is a good example ...

back2dos