First thanks for all your help guys.  I'm making nice strides learning
this language quickly.

 

I'm working with events now.  I created an arrayCollection to capture a
query from coldfusion.  I have the data being dumped into this variable
just fine (I can do a combobox on it and see all of it).  Now what I
want to do is set some variables based on these items.  I created an
event to watch the arrayCollection which would run a function to reset
the variables automatically.  Here's what I did:

 

 

This is all within a singleton class...

 

Created the [Bindable]acUser array collection

[Bindable] public var acUser:ArrayCollection = new ArrayCollection();

 

Created an init() function to set up the event handler:

      private function init():void

      { 

      acUser.addEventListener(CollectionEvent.COLLECTION_CHANGE,
acUser_collectionChange);

      }

 

Created a function to set the variables if the event hit:

      private function
acUser_collectionChange(event:CollectionEvent):void

      { 

            strEMail =
ObjectUtil.toString(acUser.getItemAt(0).strEMail);   (not sure if this
call is correct -yet-)

            trace(strEMail);

      }

 

Modified the header for the page to run the init() function

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";

      creationComplete="init()"

      xmlns="*"

      xmlns:controllers="com.cfgenerated.controllers.*"

    xmlns:login="com.cfgenerated.views.login.*"

      layout="absolute"

      currentState="NotLoggedIn">

 

 

This should be all I need to do, right?

 

When I push the data into the singleton:

 

GlobalVars.instance.acUser = event.result as ArrayCollection;

 

The event does not fire.  Any ideas?

 

 

TIA!

Reply via email to