RE: [Flashcoders] dispatching events from a class => HELP

2005-11-13 Thread Bruno Mosconi
Thanks! Btw, AS 3.0 looks like AS 2.0 FIXED... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ian Thomas Sent: domingo, 13 de novembro de 2005 16:25 To: Flashcoders mailing list Subject: Re: [Flashcoders] dispatching events from a class => HELP

Re: [Flashcoders] dispatching events from a class => HELP

2005-11-13 Thread Ian Thomas
You need to use the Delegate in your addEventListener line - because you're passing clickTab to a completely different object, which will later call back to clickTab, but doesn't have the correct context. Passing this.clickTab isn't enough - passing Delegate.create(this,clickTab) should be enough.

RE: [Flashcoders] dispatching events from a class => HELP

2005-11-13 Thread Bruno Mosconi
Why delegate if the method is inside the same Class? thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ian Thomas Sent: domingo, 13 de novembro de 2005 15:46 To: Flashcoders mailing list Subject: Re: [Flashcoders] dispatching events from a class

Re: [Flashcoders] dispatching events from a class

2005-11-13 Thread JesterXL
coders mailing list" Sent: Sunday, November 13, 2005 12:33 PM Subject: Re: [Flashcoders] dispatching events from a class Thanks Jester, I know, it was a discussion about using or not the "prototype" keyword, and if actionscript will support it in future versions. But like you say, i

Re: [Flashcoders] dispatching events from a class => HELP

2005-11-13 Thread Ian Thomas
You need to use a Delegate. As this is a question which comes up about one a week on this mailing list (not your, fault, I know!) I'm afraid I'm going to direct you to the Flashcoders Wiki page about the problem rather than answer you in full here... http://www.osflash.org/flashcoders/as2 Hope th

RE: [Flashcoders] dispatching events from a class => HELP

2005-11-13 Thread Bruno Mosconi
Hi, I'm also having problems with Events. Could someone give me a little help on this issue? The EventListener is firing fine, but its associated method CAN NOT call another Class method. Why? Here is the Main Class: (Here is the Problem) import com.ultrafactor.LblButton; class com.ultrafactor.T

Re: [Flashcoders] dispatching events from a class

2005-11-13 Thread Javier Tello
; Will be more common. - Original Message - From: "Javier Tello" <[EMAIL PROTECTED]> To: "Flashcoders mailing list" Sent: Sunday, November 13, 2005 10:25 AM Subject: Re: [Flashcoders] dispatching events from a class Yes ok Muzak, but for example, it's the way

Re: [Flashcoders] dispatching events from a class

2005-11-13 Thread Javier Tello
Yes!! Thanks a lot Martin, in the way you explain it, works. I didnĀ“t notice it before because in real coding perhaps doesn't have such issue. But it's something to remember. _ that still wont work because you are dispatching the event before you bind the function as the handl

Re: [Flashcoders] dispatching events from a class

2005-11-13 Thread JesterXL
ot;, this); Will be more common. - Original Message - From: "Javier Tello" <[EMAIL PROTECTED]> To: "Flashcoders mailing list" Sent: Sunday, November 13, 2005 10:25 AM Subject: Re: [Flashcoders] dispatching events from a class Yes ok Muzak, but for example, it

Re: [Flashcoders] dispatching events from a class

2005-11-13 Thread Martin Wood
that still wont work because you are dispatching the event before you bind the function as the handler. what are you trying to achieve (apart from getting the event to fire), i know this is just an example, but it seems a bit strange. anyway, you cant call init in the constructor to dispatch

Re: [Flashcoders] dispatching events from a class

2005-11-13 Thread Javier Tello
Yes ok Muzak, but for example, it's the way the Tween class were implemented. It is like an onEnterFrame build in event, just to get less code lines in the main movie. I do not remember who, but someone discuss this issue, relating how to implement the EventDispatcher class, and explaining to

Re: [Flashcoders] dispatching events from a class

2005-11-13 Thread Eric E. Dolecki
whats the purpose of the eventListener inside the constructor? init is being implicitly called within the class... just dispatch the event, and set up a listener in your FLA edolecki On Nov 13, 2005, at 9:37 AM, Javier Tello wrote: Still doesn't work. If you look at the code the class fi

Re: [Flashcoders] dispatching events from a class

2005-11-13 Thread Javier Tello
Still doesn't work. If you look at the code the class fired the event before deleting itself. Anyway I simplify it without the die() method: // import mx.events.EventDispatcher; // // class EventTry { // //members; //event functions; private var dispatchEvent:Funct

Re: [Flashcoders] dispatching events from a class

2005-11-13 Thread Muzak
g List" Sent: Sunday, November 13, 2005 2:33 PM Subject: [Flashcoders] dispatching events from a class > Hello, I'm having troubles implementing the EventDispatcher class with flash8. > > I do the same I use to do before, but now the class doesn't fired the event. > Here is

Re: [Flashcoders] dispatching events from a class

2005-11-13 Thread Ian Thomas
Hi Javier, This is because you've got things happening in the wrong order: - You create your EventTry() object, which calls init() - Init fires the event, but onEvent is still undefined - Init then calls die() - Die() deletes the EventTry object - You then set onEvent to your function - after every

Re: [Flashcoders] dispatching events from a class

2005-11-13 Thread Javier Tello
Correction to the post. The import statement should be; import EventTry; Hello, I'm having troubles implementing the EventDispatcher class with flash8. I do the same I use to do before, but now the class doesn't fired the event. Here is a sample class: ___ import mx.events.EventDispatche

[Flashcoders] dispatching events from a class

2005-11-13 Thread Javier Tello
Hello, I'm having troubles implementing the EventDispatcher class with flash8. I do the same I use to do before, but now the class doesn't fired the event. Here is a sample class: ___ import mx.events.EventDispatcher; // class EventTry { //event functions; private va