  | |  | EventDispatcher 1 frame delay | EventDispatcher 1 frame delay
2004-02-17 - By Tatsuo Kato
Back Muzak,
Maybe I 'm missing something but I 'm confused as to what you are up to. ;)
Why do you have to dispatch an event in the constructor of the event
dispatcher object?
It makes perfect sense that nothing happens when you dispatch an event
before the listener is registered as a listener.
Cheers,
--
Tatsuo Kato
http://tatsuokato.com
-- -- Original Message -- --
From: "Muzak " <p.ginneberge@(protected) >
To: <flashcoders@(protected) >
Sent: Wednesday, February 18, 2004 2:09 AM
Subject: Re: [Flashcoders] EventDispatcher 1 frame delay
> It has nothing to do with implementation.
>
> Try the provided code. Create a component out of it.
> Put it on stage and add event listening.
> Won 't work...
>
> var handlerObject:Object = {};
> handlerObject.init= function(o) {
> trace( "init ");
> };
> basic_mc.addEventListener( "init ", handlerObject);
>
> The thing is, it works for the standard components (i know about the doLater method).
> I was just wondering if there 's any way of getting it to work without having to jump through hoops... guess not tho.
>
> The code i provided was just sample code. So i 'm not looking to fire an 'init ' event. The thing is that "no " event fires that runs
> in the first frame.
>
> So if you 'd do something like this:
>
> function BasicClass(){
> init();
> }
> function init(){
> draw();
> }
> function draw(){
> dispatchEvent({type: "draw "});
> size();
> }
> function size(){
> dispatchEvent({type: "size "});
> }
>
> none of these events will get dispatched.
>
>
> regards,
> Muzak
>
>
> -- -- Original Message -- --
> From: "Phil Chung " <phil@(protected) >
> To: <flashcoders@(protected) >
> Sent: Tuesday, February 17, 2004 4:54 PM
> Subject: re: [Flashcoders] EventDispatcher 1 frame delay
>
>
> > Muzak,
> >
> > What does the implementation code look like? Without seeing it, my immediate guess might be that since you have to set up a
> listener for the event, and the listener has to be set up after the class is initialized (AFAIK), the listener for this event
isn 't
> in place when the initial event is dispatched via your init function (and that 's why it works when you run in after 1 frame).
> >
> > Phil
> >
> > Original Message:
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Supported by Fig Leaf Software
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Be sure to check the archives and the wiki:
http://chattyfig.figleaf.com/
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:104506
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
To unsubscribe send a blank e-mail to:
Normal Mode: flashcoders-unsubscribe@(protected)
Digest Mode: flashcoders-digest-unsubscrive@(protected)
|
|
 |