Perfect. Thanks Matt!!

-James


On Wed, 2005-02-02 at 10:05 -0800, Matt Chotin wrote:
> OK, I think maybe your bigger problem is that you want to detect
> within MyComponent when âdataâ changes (not asdf itself). Asdf should
> be changing on its own without any problems as far as I can tell
> (without really seeing your source). But in MyComponent youâll want
> to do the reacting appropriately.
> 
> 
> 
> MyComponent.mxml
> 
> <mx:VBox xmlns:mx=http://www.macromedia.com/2003/mxml>
> 
> 
> 
> <mx:Script>
> 
> private var __data : ValueObject;
> 
> //if data needs to be bindable (someone would want to bind to
> data) youâll need a [ChangeEvent()] here and dispatch that event below
> 
> public function set data(d : ValueObject) : Void
> 
> {
> 
> __data = d;
> 
> //do whatever logic to change your UI here, if you want to use
> an event to do it dispatch the event here
> 
> }
> 
> 
> 
> public function get data() : ValueObject
> 
> {
> 
> return __data;
> 
> }
> 
> </mx:Script>
> 
> 
> 
> </mx:VBox>
> 
> 
> 
> HTH,
> 
> Matt
> 
> 
> 
> 
> ______________________________________________________________________
> 
> From: James Ward [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, February 02, 2005 6:43 AM
> To: [email protected]
> Subject: RE: [flexcoders] ChangeEvent on component in mxml component
> 
> 
> 
> 
> asdf gets set by a remoteobject result handler. I think I need to
> give
> a little more detail...
> 
> I want to have code in MyComponent.mxml that has logic dependent on
> values in the valueobject. So depending on what gets passed to the
> component the component renders differently.
> 
> Thanks for the help Matt.
> 
> -James
> 
> 
> On Tue, 2005-02-01 at 22:28 -0800, Matt Chotin wrote:
> > How have you declared the asdf property? If itâs declared just as a
> > var you shouldnât need to do anything.
> > 
> > 
> > 
> > Matt
> > 
> > 
> > 
> > 
> >
> ______________________________________________________________________
> > 
> > From: James Ward [mailto:[EMAIL PROTECTED] 
> > Sent: Tuesday, February 01, 2005 2:19 PM
> > To: [email protected]
> > Subject: [flexcoders] ChangeEvent on component in mxml component
> > 
> > 
> > 
> > 
> > Hi everyone.
> > 
> > I have a mxml component with a ValueObject in it. I am binding to
> the
> > valueobject where I use the component. How can I generate an event
> > when
> > the data changes?
> > 
> > My code is something like this:
> > 
> > <MyComponent data="{asdf}"/>
> > 
> > in MyComponent.mxml I have something like:
> > 
> > <ValueObject id="data"/>
> > 
> > ValueObject is a .as file.
> > 
> > 
> > So how do I generate an event when {asdf} changes?
> > 
> > Thanks in advance.
> > 
> > -James
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >
> ______________________________________________________________________
> > 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 the Yahoo! Terms of
> > Service.
> > 
> > 
> 
> 
> 
> 
> 
> 
> 
> ______________________________________________________________________
> 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 the Yahoo! Terms of
> Service.
> 
> 




Reply via email to