Although you could do lots to make this more sophisticated, such as
creating a class for each type of data you are collecting, this looks
like a solid start.
One thing you could do to improve it (which might solve your problem),
is to let the compiler know which variables it should set up for
binding. Like this:
[Bindable]
public var client:Object;
[Bindable]
public var options:Object;
[Bindable]
public var files:ArrayCollection;
Hope that helps.
--- In [email protected], "Dan Vega" <[EMAIL PROTECTED]> wrote:
>
> Maybe I am going about this the wrong way. I would like to explain
my small
> application and get some feedback. This app started out as 1 big
file but I
> decided to break it into smaller components. The main file is pretty
small
> as you can see below. What the main app does is use a view stack to
display
> the 4 "screens" I have broken into components. The first screen is the
> client selector, once a client is selected you move on to the second
screen.
> In my client selector i dispatch an event that lets anyone listening
know
> that a client was selected, this custom event pushes the client data
back to
> the main app. The next two screens do something very similar in
pushing data
> back out of the custom component and the main app grabs.it. Once the
first 3
> screens are done its time to goto the reivew screen. The final
screen needs
> all of this data I have collected. As you can see below I simply try and
> just pass the data but it does not work. Why can't I pass complex
data but
> strings will pass just fine? Im sure my being a newb to Flex has a
lot to do
> with this but I am just wondering 2 things.
>
> 1.) What am I doing wrong here?
> 2.) How do others layout a small application similair to this ?
>
> Thank you so much for the help!!!!
>
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
> layout="vertical"
> width="760" height="500"
> backgroundColor="#000000"
> creationComplete="init()" xmlns:components="components.*"
> xmlns:views="views.*">
>
> <mx:Style source="assets/css/styles.css"/>
>
> <mx:Script>
> <![CDATA[
>
> import mx.controls.Alert;
> import mx.collections.ArrayCollection;
>
> import events.OptionsSavedEvent;
> import events.ClientSelectedEvent;
> import events.FileAddedEvent;
>
> public var client:Object;
> public var options:Object;
> public var files:ArrayCollection;
>
> private function init():void {
> }
>
> private function
> onClientSelected(event:ClientSelectedEvent):void {
> client = event.client;
> }
> private function onFileAdded(event:FileAddedEvent):void {
> files = event.files;
> }
> private function
onOptionsSaved(event:OptionsSavedEvent):void {
> options = event.options;
> }
>
> ]]>
> </mx:Script>
>
> <mx:ViewStack id="vs" width="100%" height="100%">
> <views:ClientSelector id="startPanel" vs="{vs}"
> clientSelected="onClientSelected(event)"/>
> <views:FileChooser id="fileChooser" vs="{vs}"
> fileAdded="onFileAdded(event)"/>
> <views:Options id="optionsPanel" vs="{vs}"
> optionsSaved="onOptionsSaved(event)"/>
> <views:Review id="reviewPanel" vs="{vs}" client="{client}"
> options="{options}" files="{files}"/>
> </mx:ViewStack>
>
> </mx:Application>
>
>
> Thank You
> Dan Vega
> [EMAIL PROTECTED]
> http://www.danvega.org
>