Henrik Andersson wrote:

> That they are. But they are not miracle tool. You should use them wisely and
> only when it makes sense.

I agree completely. Custom messages are for the intermediate
programmer, at least. I wouldn't recommend them for a beginner. On the
other hand, I don't think you can consider yourself an advanced coder
unless you understand custom messages (including when to use them).

> Sounds like you missed Event.COMPLETE, it is just as good to signal when a
> task is done.

No, I know all about Event.COMPLETE. I have a lot of things happening
that send a message when they finish, and I like to target the right
method.

Another legimate approach would be to send all the Event.COMPLETE
message to a method that decides where to route them, probably in a
switch statement. I just happen to prefer to target a specific
listener.

> Did you bother adding any properties in your custom class? If not, you could
> just have used the Event class instead.

Of course. The custom class has properties and methods that aren't in
the Event class.

> Actionscript is a garbage collected language, objects can not vanish while
> they are used as the value of this for a method. And if you manage to pull a
> stunt like that in something like c++, bad you.

Agreed completely. I've been programming for over 25 years, and  I
made all the stupid mistakes years ago. My blunders now are more
sophisticated ;-)

I think it's a valid point, though--even though it's
garbage-collected, it still has a call stack. If a method in object A
calls a method in object B, object A won't be eligible for garbage
collection until the method in object B is finished.

An advanced programmer will understand this (or at least should). It
could lead to hard-to-find bugs, though. If you destroy an object
while it's on the call stack, you will get, at a minimum, a memory
leak.

Things like a call stack, garbage collection, memory leaks, and the
like are more advanced concepts. And, as Jason says, we should be
willing to accomodate less-advanced coders here.

Cordially,

Kerry Thompson
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to