flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik de Bruin <e...@ixsoftware.nl>
Subject Re: [ASJS] Some information on "templates"
Date Thu, 06 Dec 2012 12:49:40 GMT

After I'm done fixing the mess I made in SVN, I'll start work on the
'template', but here is the basic idea to get you started: I would
like the compiler to output "intermediate" JS, by which I mean "human
readable". My Publisher then takes this intermediate code and puts it
through the Google Closure Builder, which optimises and minifies it.
The advantage of having the "intermediate" step is that it makes
debugging much (MUCH) easier. It will allow us to write tests,
something that minified code won't. And it will let us run the code in
the various browser based tooling and have the output make sense.

So, to the basics (remember this is a work in progress!):

AnActionScript (AS) class:

package just.some.package

import mx.controls.Button;

public class MyClass extends Button
    public function MyClass()

    private var _privateVar:String = "do ";

    public var publicProperty:Number = 100;

    public function myFunction(value: String): String
        return "Don't " + _privateVar + value;

Should output the following JavaScript (JS) object:



 * @constructor
 * @extends {org.apache.flex.html.staticControls.TextButton}
just.some.package.MyClass = function() {

     * @private
     * @type {string}
    this.privateVar_ = 'do ';

 * @expose
 * @type {number}
just.some.package.MyClass.prototype.publicProperty = 100;

 * @this {just.some.package.MyClass}
 * @param {string} value The value argument.
 * @return {string} The nicely concatenated return.
org.apache.flex.core.ViewBase.prototype.myFunction = function(value) {
    return 'Don\'t ' + this.privateVar_ . value;

That should give you a broad idea of what needs to be done. There are
obviously other constructs that I don't address here, but as a start
it should serve you well.



On Thu, Dec 6, 2012 at 1:12 PM, Michael Schmalle
<apache@teotigraphix.com> wrote:
> Hi Erik,
> This is mainly directed at you. Can you give as much information as to can
> on what needs to be produced from the compiler?
> I finally have myself back up and running so I want to try and change the
> output code. It will be a way to get my hands dirty and try to break things.
> This way maybe Alex can do other important things. If I can't get it, I'll
> let the list know. :)
> I am looking at the code you committed to figure out the "flow".
> By using this framework (goog closure) does that mean we have access to all
> their UI components in javascript and html? If so, this means we actually
> have a component platform that can start to be integrated with Flex
> components? ... our new component framework I mean.
> Remember I am completely ignorant to js, but learning a lot now.
> Mike
> --
> Michael Schmalle - Teoti Graphix, LLC
> http://www.teotigraphix.com
> http://blog.teotigraphix.com

Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl

View raw message