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();
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
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:
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 =
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
@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
/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
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
-
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
/
_
-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
, 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
11 matches
Mail list logo