[Flashcoders] AS 2 Delegate question

2007-06-02 Thread Stefano Nappa
Hi, a question. I'm talking about AS 2. Inside a method of a class I've: btnCollection.onRollOver = function() { // here this is the button var t = Number(this._name.substr(1, 1)); // Mouse.hide();

Re: [Flashcoders] AS 2 Delegate question

2007-06-02 Thread Ruy Adorno
Well, what I understand about the Delegate class, is that you canĀ“t send any parameter through the Delegate.create method, any parameter you want to pass, must be send by the event. btnCollection.onRollOver = Delegate.create(this, btnRollOver); In this case the delegate will send to the

RE: [Flashcoders] AS 2 Delegate question

2007-06-02 Thread Merrill, Jason
In this case the delegate will send to the btnRollOver function only the parameters of the event onRollOver. You will have to find another way to solve this problem... maybe extend the MovieClip class, or maybe it could be better to not use the delegate. Actually, you can do it this way:

Re: [Flashcoders] AS 2 Delegate question

2007-06-02 Thread Alain Rousseau
Or you could use another Delegate class. There is the Proxy class I believe (can't remember who did it) and the one I use the most is the one on dynamicflash.com http://dynamicflash.com/2005/05/delegate-version-101/ You can pass parameters in the Delegate call myButton.onRelease =

Re: [Flashcoders] AS 2 Delegate question

2007-06-02 Thread Muzak
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

RE: [Flashcoders] AS 2 Delegate question

2007-06-02 Thread Jesse Graupmann
@chattyfig.figleaf.com Subject: Re: [Flashcoders] AS 2 Delegate question 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

Re: [Flashcoders] AS 2 Delegate question

2007-06-02 Thread Muzak
/MyButton.html regards, Muzak - Original Message - From: Jesse Graupmann [EMAIL PROTECTED] To: flashcoders@chattyfig.figleaf.com Sent: Sunday, June 03, 2007 1:43 AM Subject: RE: [Flashcoders] AS 2 Delegate question Muzak, You bring this up every time proxy is mentioned. Do you mind sharing

RE: [Flashcoders] AS 2 Delegate question

2007-06-02 Thread Jesse Graupmann
Subject: Re: [Flashcoders] AS 2 Delegate question This isn't about quick and easy, but about encapsulation, OOP and best practices. Quick and easy also often means quick and dirty ;-) Here's a stripped down version of a custom button. import mx.events.EventDispatcher; import mx.utils.Delegate

Re: [Flashcoders] AS 2 Delegate question

2007-06-02 Thread Muzak
- From: Jesse Graupmann [EMAIL PROTECTED] To: flashcoders@chattyfig.figleaf.com Sent: Sunday, June 03, 2007 3:22 AM Subject: RE: [Flashcoders] AS 2 Delegate question Ha! That's rad. I guess the trick is writing a Flash app to write the bulk of the code... Got links to any of those

RE: [Flashcoders] AS 2 Delegate question

2007-06-02 Thread Jesse Graupmann
/ _ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Muzak Sent: Saturday, June 02, 2007 5:54 PM To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] AS 2 Delegate question This isn't about quick and easy, but about

Re: [Flashcoders] AS 2 Delegate question

2007-06-02 Thread Muzak
, 2007 5:52 AM Subject: RE: [Flashcoders] AS 2 Delegate question So is this still out of the question... /// /// IN FLA /// var box = this.attachMovie ( 'box', 'box', this.getNextHighestDepth() ); jgButton.initializeMovieClip ( box ); box.data = 'this is my data'; box.showEvents