Alex,

I've been encountering two situations that don't quite fit into the FlexJS
paradigm but may fit somewhere.

*Use Case 1:*
I'm a web developer who likes to write all my HTML by hand or I already
have a project in HTML and the markup and CSS cannot be changed. But I've
heard about FlexJS and AS3 and how it will benefit my project. Is there a
way I can place or pull in my own HTML/CSS with FlexJS?

My FlexJS finished application may look something like this (
http://pastebin.com/ga0Gq8C6):

<js:Application>

    <fx:Declarations>
        <js:HTTPService id="stocks"/>

        <!-- so we can reference it in our code. we some how bind this
to the hand typed one -->
        <js:HTMLElement id="myButton" click="buttonHandler()"/>
    </fx:Declarations>

    <fx:Script>
        <![CDATA[
            public function buttonHandler():void {
                alert("hello world");
                myButton.label = "My Button";
            }
        ]]>
    </fx:Script>

    <!-- Placed inside body tag -->
    <js:HTMLPassthrough>
        <![CDATA[
            <div>
                <button id="myButton"/>
            </div>
        ]]>
    </js:HTMLPassthrough>
    <!-- Placed inside body tag. An ad, custom code or other. -->
    <js:HTMLPassthrough>
        <![CDATA[
            <div id="google_analytics"></div>
            <script src="google.js">
        ]]>
    </js:HTMLPassthrough>


</js:Application>


In this scenario I would be responsible for managing all my HTML markup and
CSS styling. FlexJS would handle the rest.

*Use Case 2: *

I'm a web developer who likes to write my own native HTML Elements in the
body tag but I would like to write it in XML. Is there a way I write type
safe HTML markup? My FlexJS application may look something like this (
http://pastebin.com/e0WybNXc):

<js:Application>

    <fx:Declarations>
        <js:HTTPService id="stocks"/>
    </fx:Declarations>

    <fx:Script>
        <![CDATA[
            public function buttonHandler():void {
                var output:String = "hello world";
                myButton.label = "hello world";
                alert("hello world");
            }
        ]]>
    </fx:Script>

        <!-- these classes mirror their HTML counterparts -->
        <js:Body style="width:100%;height:100%">
                
                <js:Button id="myButton" click="buttonHandler()"/>
                
                <js:Div style="display:display-inline;bottom:20px:right:20px">
                        <js:Label text="Made in FlexJS"/>
                </js:Div>
                
                <js:HTMLElement type="input" >text</js:HTMLElement>
                
        </js:Body>


</js:Application>


How hard would it be for FlexJS be made to fit these two cases? I think I
know how to do the second case if it's not done already but would have
questions.

Reply via email to