getting Deep into Flex

The better you understand what you are doing, the better you will do it.

I want to get Deep into Flex . I did some simple Event-Handling and The better you understand what you are doing, the better you will do it.

But i have i big question:

What does the Compiler do ?! What happens with the MXML file ?

lets say we have a simple code ( code from blogflexexamples):

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/12/27/changing-the-flex-colorpicker-controls-swatch-panel-background-color/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="top"
        backgroundColor="white">

    <mx:Style>
        .myColorPicker {
            swatchPanelStyleName: myCustomSwatchPanelStyleName;
        }

        .myCustomSwatchPanelStyleName {
            backgroundColor: haloBlue;
        }
    </mx:Style>

    <mx:Script>
        <![CDATA[
            import mx.events.ColorPickerEvent;

            private function backgroundColor_change(evt:ColorPickerEvent):void {
                var cssObj:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".myCustomSwatchPanelStyleName");
                cssObj.setStyle("backgroundColor", evt.color);

                colorPicker.open();
            }
        ]]>
    </mx:Script>

    <mx:ApplicationControlBar dock="true">
        <mx:Form styleName="plain">
            <mx:FormItem label="backgroundColor:">
                <mx:ColorPicker change="backgroundColor_change(event);" />
            </mx:FormItem>
        </mx:Form>
    </mx:ApplicationControlBar>

    <mx:ColorPicker id="colorPicker"
            styleName="myColorPicker"
            editable="false" />

</mx:Application>

does this generate an Actionscript file ? and if it does : Can i see the the .as file ( like preprocessor in C++ )?

Answers


Yes. MXML is translated into an ActionScript class. You can see the generated as code by adding -keep-generated-actionscript switch to the Additional compiler arguments in Project properties->Flex compiler.


Need Your Help

jQuery bind/change to Drop Down Form

javascript jquery datatables zurb-foundation

I had a longer post describing what I am trying to do, but I don't think that is necessary so I'm making this simple. I'm working on getting Zurb Foundation to work with Datatables. It's been pre...

Javascript - Replace lots of if statements

javascript if-statement refactoring code-cleanup

I have a a couple of different radio buttons which return an ethnicity and a gender. The script runs inside an internal application so rather than returning "boy", "girl" or "both" I get back 77073...