Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 782123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:20:13+00:00 2026-05-14T20:20:13+00:00

I’m looking for a full featured AOP Library for Actionscript 3. The following projects

  • 0

I’m looking for a full featured AOP Library for Actionscript 3.

The following projects I noticed so far, but they all seem to have their problems:

  • http://farmcode.org/page/Sodality.aspx
    looks most promising so far, however it requires you to create a whole new class for every AOP “call” I believe, and it forces you to follow quite a lot of restrictions, anyone has experience with it?
  • http://code.google.com/p/loom-as3/
    this one is discontinued
  • http://code.google.com/p/floxy/
    dynamic proxy generation? this isn’t really AOP as I know it, right?
  • http://code.google.com/p/flemit/
    dynamic byte code generation? this is something AOP needs I think, but not the full featured AOP framework I am looking for

Does anyone know of a better solution? Or does anyone have any experiences with AOP in Actionscript 3?

Best regards,

Tom

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T20:20:13+00:00Added an answer on May 14, 2026 at 8:20 pm

    AOP in ActionScript 3 is really hard. All aproaches have their problems:

    • proxying: actually works fine and transparent to the programmer, but not to the runtime. If any function signature expects an object of type A, then a proxy to an object of type A will fail to pass the typecheck
    • bytecode generation: well, sort of works, but not too good. loading bytecode in AVM2 is asynchronous, so you can’t do it just in time. Also, once bytecode is loaded, there’s no way of discarding it, so you can not modify a class a second time.
    • anything else is verbose

    What you can do is to use Haxe. Not only does Haxe have other advantages over AS3, but it also allows some AOP. There are two approaches:

    Dynamic Methods

    In Haxe, you can declare methods to be dynamic. These can be replaced at runtime to provide advices. Let me explain, what happens under the hood. The following Haxe code:

    public function foo(param1:Type1):Type2 { /*body*/ }
    public dynamic function bar(param1:Type1):Type2 { /*body*/ }
    

    Is the equivalent of the following AS3 code:

    public function foo(param1:Type1):Type2 { /*body*/ }
    public var bar:Function = function (param1:Type1):Type2 { /*body*/ }
    

    Using the latter always performs worse than the former, since there’s a lot of runtime type checking involved. In Haxe however, you do not lose the compile time benefits of strict typing, unlike in AS3.

    Likewise, using Haxe’s accessors (that are indeed very different from AS3’s), you can also use AOP for properties:

    public var foo(get_foo, set_foo):Type;
    dynamic function get_foo() {//Haxe will automatically infer types: http://haxe.org/ref/type_infer
        return this.foo;
    }
    dynamic function set_foo(param) {
        return this.foo = param;
    }
    

    Any methods, that are dynamic can be replaced at runtime to do whatever you wish. AS2 allowed this, and libraries like as2lib provided AOP. unfortunately, it is no longer available. But I guess you can figure out the rest on you own.

    Proxying

    Haxe has the notion of anonymous types. At runtime, these are merely * (thus a perfomance loss is to be expected), but at compile time, they are type safe. What you can do, is create a proxy to an object of whatever type you need and use it as AOP container. In your whole code, you never use its type explicetely, but rather an equivalent anonymous type. The problem with proxying I described will be gone. The only thing you need to do is to make an unsafe cast of your proxy to that anonymous type.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 385k
  • Answers 385k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I fashioned it into a dictionary of time lists actor_sets… May 14, 2026 at 11:29 pm
  • Editorial Team
    Editorial Team added an answer Each file needs it own line like so: stylesheets[all][] =… May 14, 2026 at 11:29 pm
  • Editorial Team
    Editorial Team added an answer Libraries such as Curses do it much the same way… May 14, 2026 at 11:29 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.