That change event will only be triggered if you actually assign a new value:

model.someWrappedArrayCollectionInstance = anotherObject;


Modifying that same instance will not trigger the change event for
this property.


But something like this might work for you:

<adobe.ac:Observe
 source="{ model.someWrappedArrayCollectionInstance.length }"
 handler="{ handler }" />


Peter



On 3/1/07, sethelijahroot <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Having some questions about how best to implement this.  So far, I'm
> not having much success.
>
> (I'll be using Paul Williams Observe tag as extended by Alex Uhlmann )
>
> I can't get the handler function to trigger, because the source is not
> dispatching a proper event.  I can listen to the events in my Class,
> and using ArrayCollection.addItem dispatches just fine.
>
> The problem lies in translating that eventListener into something the
> Observe tag can see as an Event("changed") or something similar.
>
> Help!
>
> <mxml
>   creationComplete="runTest()">
>
> <mx:Script>
>   private var model:Model = Model.getInstance();
>
>   private function runTest():void
>   {
>     // This should trigger the observe tag to run the handler
>     model.someWrappedArrayCollectionInstance.addSpecificDataTypeObj( {} );
>   }
>
>   private function handler( myList:* ):void
>   {
>     // THIS IS WHAT I CAN'T GET TO TRIGGER!!
>   }
> </mx:Script>
>
> <adobe.ac:Observe
>   source="{ model.someWrappedArrayCollectionInstance }"
>   handler="{ handler }" />
>
> </mxml>
> _________________________________________________
>
> import mx.events.CollectionEvent;
> public class WrappedArrayCollection
> {
>   private var collection:ArrayCollection = new ArrayCollection([]);
>
>   public function WrappedArrayCollection()
>   {
>     collection.addEventListener( CollectionEvent.COLLECTION_CHANGE,
> collectionChangeHandler );
>   }
>
>   private function collectionChangeHandler():void
>   {
>     trace("this part works fine");
>     // Should i dispatch an event here for the binding to trigger?
>   }
>
>   public function addSpecificDataTypeObj( obj:SpecificDataType ):void
>   {
>     collection.addItem( obj );
>   }
> }
>
>
>
>
> --
> 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
>
>
>
>

Reply via email to