Here you are :

In your custom component (custom comp is a panel in this example):

<?xml version="1.0" encoding="utf-8"?> <mx:Panel xmlns:mx="
http://www.adobe.com/2006/mxml"; xmlns:ns1="components.*" width="1000"
height="100%" >
<mx:Metadata>
[Event(name="expandMe", type="flash.events.DataEvent")]
</mx:Metadata>
...
</mx:Panel

and then wherever you use this you can do:

<customComp expandMe="Alert.show('Expand dispatched')"/>

Make sure that somewhere in your custom component you throw the event:

this.dispatchEvent(new DataEvent("expandMe")) ;

;-)

On Mon, Jun 28, 2010 at 4:01 PM, aceoohay <pa...@compuace.com> wrote:

>
>
> Alex:
>
> Thanks for the pointer, I will investigate it further when I get to the
> office.
>
> If you have a link that shows someone doing what I am trying to do, that'd
> help a lot.
>
> Paul
>
>
> --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>, Alex
> Harui <aha...@...> wrote:
> >
> > [Event] metadata?
> >
> >
> > On 6/27/10 8:48 PM, "aceoohay" <pa...@...> wrote:
> >
> >
> >
> >
> >
> >
> > The "thing" I am referring to in my original post is of course the
> "myMethodComplete" thing.
> >
> > I have defined all manner of properties in my components, including
> "functions", I just don't know how to begin defining an "anonymous block" of
> code.
> >
> > Paul
> >
> > --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com><mailto:
> flexcoders%40yahoogroups.com <flexcoders%2540yahoogroups.com>> ,
> "aceoohay" <pauls@> wrote:
> > >
> > > This is probably all ready answered, but I can't think of how to search
> for it.
> > >
> > > I have a custom component. This component has a method. When this
> method completes I want to execute user defined code similar to how a
> focusOut handler allows the programmer to define a block of code in the mxml
> like;
> > >
> > > <mx:TextInput focusOut="myvar='test';myfunction('abc');">
> > >
> > > I would like to define;
> > >
> > > <ns1:myComponent myMethodComplete="myvar='test';myfunction('abc');">
> > >
> > > I just don't know how to define the thing (handler? property? method?
> it would help if someone would tell me what it is called) that will do this.
> > >
> > > If you can show me, or show me where to go I would appreciate it.
> > >
> > > Paul
> > >
> >
> >
> >
> >
> >
> >
> > --
> > Alex Harui
> > Flex SDK Team
> > Adobe System, Inc.
> > http://blogs.adobe.com/aharui
> >
>
>  
>

Reply via email to