Building a larger application involves a combination of view states
and MXML components.  Take JesterXL's Amazon search example:

http://www.jessewarden.com/archives/2006/07/flex_2_webservice.html

In this example, you can see the use of view states.  This is how many
"screens" can be combined into one.  I definitely suggest you look at
States in the Flex help.

In the same example, a modal window is used to show debugging info.
The same technique can load in forms in the form of MXML components.
You can have a directory of forms, each one something like this:

<!-- windowView.mxml -->
<?xml version="1.0"?>
<mx:TitleWindow
    showCloseButton="true" close="PopUpManager.removePopUp(this);"
creationComplete="initApp();"
    xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute">
    <mx:Script>
        <![CDATA[
            import mx.managers.PopUpManager;

            private function initApp():void {
                this.title = "Job Listing";
            }
            private function cancel():void {
                PopUpManager.removePopUp(this);

            }
        ]]>
    </mx:Script>

    <mx:VBox verticalAlign="top" width="100%" height="100%"
verticalGap="10" paddingBottom="5" paddingLeft="5" paddingRight="5"
paddingTop="5" x="4" y="4">
        <mx:Form width="100%" height="100%">
            <mx:FormItem label="Location:">
                <mx:Label text="Albany, NY" width="100%"/>
            </mx:FormItem>
            <mx:FormItem label="Job Type:">
                <mx:Label text="Contract" width="100%"/>
            </mx:FormItem>
            <mx:FormItem label="URL:">
                <mx:Label text="http://www.epicenterconsulting.com";
width="100%"/>
            </mx:FormItem>
            <mx:FormItem label="Description:">
                <mx:TextArea wordWrap="true" text="dolor sit amet,
consectetuer adipiscing elit. Donec diam tortor, viverra vitae,
vestibulum in, molestie posuere, felis. Morbi posuere interdum nulla.
Aenean libero pede, pretium lacinia, consectetuer in, vehicula non,
enim. Morbi at enim.." width="200" height="200"/>
            </mx:FormItem>
            <mx:FormItem label="Apply:">
                <mx:Label htmlText="dolor sit amet,
[EMAIL PROTECTED]" width="100%"/>
            </mx:FormItem>
        </mx:Form>
    </mx:VBox>
</mx:TitleWindow>

Then you can invoke this window from your main.mxml:

private function showModalWindow():void {
         myModal = TitleWindow(PopUpManager.createPopUp(this, windowView, 
true));
         myModal.width = 440;
         myModal.height = 465;
         myModal.x = 0;
         myModal.y = 0;
         myModal.addEventListener("mouseDownOutside", enableAll);
}

Combine this technique with States and a TabNavigator and you have a
lot of room to build a large app.  I'm in the same boat as you,
learning Cairngorm by examples and by reading the list and
experimenting.  The learning curve is fairly steep, and without the
help of examples, putting the pieces together can be a slow process.
You aren't alone, but it can feel like it sometimes.  As I learn new
stuff I'll be sure to post tutes on my blog for people to check out.
I also recommend checking all the examples at Adobe -- Mike Potter's,
etc -- they are extremely helpful.

hth,

Mike Britton


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to