RE:[Flashcoders] dispatching events at creation time?

2006-02-17 Thread azsl1326-email
A little late in the (reply) game, but you could try: MovieClip.prototype.onConstruct = function() { trace(created) } This will be called anytime a new clip is created. You could, however, weed out the unwanted dispatching of events, by dispatching based upon the name of the clip created,

Re: [Flashcoders] dispatching events at creation time?

2006-02-17 Thread Aaron Smith
if you subclass movieclip then you have access to the onLoad method. Just overload that and put your dispatch in there public function onLoad():Void { dispatchEvent({type:'onload', target:this}); } [EMAIL PROTECTED] wrote: A little late in the (reply) game, but you could try:

Re: [Flashcoders] dispatching events at creation time?

2006-02-16 Thread John Giotta
I've done it the same you have, but it only worked correctly in IE. Basically, I was replacing the MovieClip.onLoad, but when I tested in Firefox it never happened. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the

Re: [Flashcoders] dispatching events at creation time?

2006-02-16 Thread Stefan Mees
You can dispatch a Event at creation time, but no listener can listen to this event at creation time ;-) What came firstThe chicken or the egg? ;-) Luca Candela schrieb: -- class tryOut { public var addEventListener:Function; public var

Re: [Flashcoders] dispatching events at creation time?

2006-02-16 Thread John Giotta
You can dispatch a Event at creation time, but no listener can listen to this event at creation time ;-) Yeah that would help. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive:

RE: [Flashcoders] dispatching events at creation time?

2006-02-16 Thread Ben Smeets
Just a quicky, but why would you want to know when an object is created? If you don't give anything back (like throwing an exception) you van assume the contructing worked can't you? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Luca Candela Sent:

Re: [Flashcoders] dispatching events at creation time?

2006-02-16 Thread Luca Candela
I resolved this issue with a callback to a function defined outside the class that sends the Event. anyone can tell me anything about my other problem of the day? On 2/16/06, John Giotta [EMAIL PROTECTED] wrote: You can dispatch a Event at creation time, but no listener can listen to this