Is this now gone?

I am trying to add an EventListener to a Control that doesn't reside
locally to the main application.  With that said, I need to use the
Delegate Class in order to specify the proper scope.

In Flex 1.5 as well as Flash, I would have coded my function similar to
this:

private function addEventListener():void
{
        myControl.addEventListener("change",
mx.utils.Delegate.create(this, onControlChange));
}

private function onControlChange( event:Event ):void
{
        // Change code goes here
}

Of course, the compiler knows nothing of the Delegate class and I get a
compile error -

This question also relates to my previous post, and I am hitting a major
brick wall with this scoping stuff.  I had this down to a science with
all the Flash Applications I wrote in the past...  I am getting a tad
frustrated, trying to port all my AS 2.0 code, to the new Flex
environment.  Even Flex 1.5 had the Delegate Class - so Flex 2.0 must
have done away with it???  If so, how am I supposed to scope my
functions???

Thanks in advance for all your help,

Mike

Reply via email to