Re: [Flashcoders] Delegating Events and AS2

2006-09-27 Thread Sean Scott
Thanks all for the feedback. I ended up using Joey Lott's Proxy class. On 9/26/06, vic [EMAIL PROTECTED] wrote: Danno, that is really cool, I will try that but I have done it, I made a site template that, when a button is clicked it dispatches an Event...but I had the hardest time doing

Re: [Flashcoders] Delegating Events and AS2

2006-09-27 Thread John Grden
I think Delegate gives you what you're talking about Vic - control over your scope issues. Delegate enables you to manage scope with in your class. So, if you have an XML object and you want to maintain the response/return in your class, you do just as Dan has described. make sense? On

Re: [Flashcoders] Delegating Events and AS2

2006-09-27 Thread vic
flashcoders@chattyfig.figleaf.com Sent: Wednesday, September 27, 2006 8:13 AM Subject: Re: [Flashcoders] Delegating Events and AS2 I think Delegate gives you what you're talking about Vic - control over your scope issues. Delegate enables you to manage scope with in your class. So, if you have

Re: [Flashcoders] Delegating Events and AS2

2006-09-27 Thread John Grden
Timer(1000); myClass.addEventListener('timeout', Delegate.create(this, handleConstruct)); - Original Message - From: John Grden [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Wednesday, September 27, 2006 8:13 AM Subject: Re: [Flashcoders] Delegating

Re: [Flashcoders] Delegating Events and AS2

2006-09-27 Thread Dan Rogers
The problem is with this code- the onRelease function is a method of the btn movieclip... so it doesn't have access to the dispatchEvent function. btn.onRelease = function() { trace('dispatching event'); dispatchEvent({type:'click', target:this, message:btn+' was

Re: [Flashcoders] Delegating Events and AS2

2006-09-26 Thread Steve Polk
I have been using this class for all my event needs. Simply import the class, then to use: EventManager.getInstance().addListener(eventDoThis, this); //adds the listener to the class ('this' is the scope) EventManager.getInstance().removeListener(eventDoThis, this); //removes the listener

RE: [Flashcoders] Delegating Events and AS2

2006-09-26 Thread Mike Keesey
Whoops! -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Mike Keesey Sent: Tuesday, September 26, 2006 2:23 PM To: 'Flashcoders mailing list' Subject: RE: [Flashcoders] Delegating Events and AS2 [...] Or, if using AS3.0, I think you

Re: [Flashcoders] Delegating Events and AS2

2006-09-26 Thread Dan Rogers
I personally use an extremely simplified way of dealing with events. I've used EventDispatcher before, but it feels like overkill most of the time. I realize my method has no ability to multicast events, but it's quick, easy to read and gets the job done. Here's an example:

Re: [Flashcoders] Delegating Events and AS2

2006-09-26 Thread vic
Hey Dan, I like the way you do it, its pretty simple. But here is, what probably will be an incredibly stupid question: How do I capture the event? Thanks, V I personally use an extremely simplified way of dealing with events. I've used EventDispatcher before, but it feels like overkill

Re: [Flashcoders] Delegating Events and AS2

2006-09-26 Thread Dan Rogers
Vic, if you've ever used the XML or NetStream classes... it mimics those types of event updates. For example... var xmlData = new XML(); xmlData.onLoad = function () { // gets invoked by the XML instance } So if you delegate the onLoad method, you get something like this:

Re: [Flashcoders] Delegating Events and AS2

2006-09-26 Thread vic
Danno, that is really cool, I will try that but I have done it, I made a site template that, when a button is clicked it dispatches an Event...but I had the hardest time doing it. I am looking for a simple way to do it that works in a Class. without worrying about scope. Mine relies heavily