Create a custom Button component that has public methods and properties that 
you can access.
Have your custom Button dispatch a click event, just like the v2 Button 
component does.

Others might suggest to use a Proxy class that lets you pass extra parameters, 
I'd suggest not to do so.

Simply create your own Button and you'll have all the power you need.

regards,
Muzak

----- Original Message ----- 
From: "Stefano Nappa" <[EMAIL PROTECTED]>
To: <flashcoders@chattyfig.figleaf.com>
Sent: Saturday, June 02, 2007 5:33 PM
Subject: [Flashcoders] AS 2 Delegate question


>
> Hi, a question.
>
>
> I'm talking about AS 2.
>
> Inside a method of a class I've:
>
>
>
> btnCollection.onRollOver = Delegate.create(this, btnRollOver(btnCollection));
> after having built this method:
>
> private function btnRollOver(whichBtn) {
>        var t = Number(whichBtn._name.substr(1, 1));
>        //
>        Mouse.hide();
>        //
>        cursor._visible = true;
>        startDrag(cursor, true);
>        //
>        setRotation(curPos[t]);
>    }
>
>
> nothing works like before.
>
>
> That is: I probably easily get the class reference but I've lost the
> reference to the single button...
>
> I even tried (with no results):
>
> 1. btnCollection.onRollOver = Delegate.create(this,
> btnRollOver, btnCollection);
>
> 2. changing btnCollection to be a class variable (not a local one);
>
> Please, can you help me better understand this issue? What am I doing wrong?
>
> Thanks!


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to