flasheister,
[quoted text, click to view] > Just one more question on that topic...if I use the onPress,
> i just assign it to the MC like this.onPress = function () etc...
> so i can do something when it is pressed.
Sure.
[quoted text, click to view] > Should or in what situation should I use listeners rather that
> the just assigning an onPress event directly to the MC
Here's a blog entry on that.
http://www.quip.net/blog/2006/flash/event-handlers-listeners In summary: some objects are written to expect event handlers and some
are written to expect listeners. You use handlers for the one kind and
listeners for the other. ;) The quickest way I can think of to tell which
is which is to learch the term "addListener" in the ActionScript 2.0
Language Reference. You'll get an awful lot of search results to sift
through, but you'll eventually see all the classes that expect this sort of
event handling.
[quoted text, click to view] > Seems to just assinging events like onPress, onRollOver, etc.
> is easiest to just assign them when I attach them to the stage.
That's just the thing, flasheister, you're not "just attaching them to
the Stage." When you use those events as stand-alone actions, you're
actually assigning them to a movie clip -- because the main timeline *is* a
movie clip. Since that's what you're doing anyway, you may as well use the
full syntax. Easier to understand, and you'll be able to "see" what you're
doing clearer. My opinion, anyway.
David
stiller (at) quip (dot) net
Dev essays:
http://www.quip.net/blog/ "Luck is the residue of good design."