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

  • Home
  • SEARCH
  • 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 6724517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:41:57+00:00 2026-05-26T09:41:57+00:00

This is a bit of a crazy question, but does anyone out there know

  • 0

This is a bit of a crazy question, but does anyone out there know how to go about writing an extra compile step into the flex compiler. The idea would be that the MXML compiler would knock out the MXML to AS3 code as it does, but we have an extra step between the AS3 code and the bytecode.

The reason why I ask, is that this would be a great step to handle things like metadata tags to make code changes. A common practice in a lot of frameworks is to have an [Inject] tag before a variable. I.e. [Inject] public var user:IUser.

What would be really, really cool, is if the inject tag could be recognised, interpreted in some way, and then hardwired to a singleton, or whatever. For example, you could have a config file that defines IUser to be a User object. The compiler would interpret that, and replace the [Inject] public var user:IUser with public var user:IUser=UserConfig.instance.user;

This is jsut one of the many things that would be possible if I knew how to do this step. I was just wondering if someone would know even where to start about how to go about doing this.

  • 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-26T09:41:58+00:00Added an answer on May 26, 2026 at 9:41 am

    The compiler is open source, and there’s lots of examples in the codebase the show how the compiler modifies the Abstract Syntax Tree (which is what the source code gets parsed to) at compile time.

    I’d suggest taking a look at the [Embed] or [SkinPart] extensions. (I’ve discussed this before with links to examples here.)

    Be warned though – this stuff is not for the faint of heart. If you’re new to compilers, and how they work, I highly recommend this book on ANTLR, which gives a thorough overview on the process of parsing Source Code to AST’s and then how they are interpreted.

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

Sidebar

Related Questions

I know this question might sound a little bit crazy, but I tough that
This might sound like a little bit of a crazy question, but how can
This is a bit of a crazy idea, but would there be a way
Maybe this sounds a little bit crazy, but I need to come up with
This may sound a bit provocative but it actually is a real question. Feel
I need a script to edit files. Im going a bit crazy about this
I know its sounds a bit crazy, but im doing some pretty complex (complex
This isn't exactly specifically a programming question (or is it?) but I was wondering:
This problem is driving me a bit crazy. The code seems to be segmentation
i think i am going a bit crazy, when i test this on my

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.