Hello,
I'm trying something that might be obvious, but somehow isn't. What I'm
trying to do is broadcasting a message on a setinterval basis.
I've set up my events broadcaster class and it worked quite well.
The problem i had with it was that it extended MovieClip.. The only reason
for this was the onEnterFrame function, seemed a waste.
I came up with this to replace the onEnterframe and subsequently have the
eventbroadcaster class extend Object instead of MovieClip:
this.intervalID=setInterval(this.fireInterval,interval); <---- in the class'
constructor
function fireInterval(){
//_root.log.log(this._listeners);
this.broadcastMessage("onInterval",this.event);
}
Now, i've traced within the fireInterval function, and it works fine.
Problem is, the listeners never get the onInterval event broadcasted to
them.
When i do this(it also listens to key events):
function keyDown(){
this.broadcastMessage("onInterval",this.event);
}
it DOES work... So i'm quite stumped here,
first of all the fireInterval function gets executed, but the listeners
never hear it and
secondly, when I have a key event broadcast the event, the listeners DO hear
it...
What's the problem here? Don't AsBroadcaster and setInterval like each
other?
thanks,
Meinte
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders