> How would a child call a function in the parent though?

 

parentDocument.someMethod();

 

- Gordon

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of ben.clinkinbeard
Sent: Saturday, August 12, 2006 3:12 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Best way to reference items in a parent MXML component?

 

How would a child call a function in the parent though? Events don't
seem (semantically) like the right thing because I basically just want
to use a utility function defined in the parent. Like I have a
function that I am using to format the dataTips of my charts in the
child components, but dispatching an event every time I roll over a
chart item seems a bit tedious and extreme.

Is there a better way or do I just need to get used to using events? I
come from a Flash background and have not used events very much.

Thanks,
Ben

--- In [EMAIL PROTECTED]ups.com, "Sergey Kovalyov"
<skovalyov.flexcode[EMAIL PROTECTED]> wrote:
>
> Events must be used here. Your child elements should dispatch custom
> events and container that holds them should listen to that events.
> Event listener will handle the child via target property of event
> object.
>
> On 8/12/06, ben.clinkinbeard <ben.clinkinbeard@...> wrote:
> > I have a ViewStack whose child elements each contain a graph. I would
> > like to define some things in the file that holds the ViewStack so
> > that all of the child charts can use them, but am not sure of the best
> > way to reference and call these things. Ideally I would like to
> > somehow pass in a reference to the containing object so that I don't
> > have to pass several items into each child, but have yet to figure out
> > a way to do that. I know there has to be a better way than what I have
> > now:
>

__._,_.___

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





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to