sholditch,
Your problem happens in these two lines:
> btnPreschool.addEventListener (MouseEvent.CLICK,
gotoAndStop);
> function gotoAndStop(evt:MouseEvent) {
The reason this is a problem is because ActionScript already
contains a
function (actually, a MovieClip method) called gotoAndStop().
In the lines
you just showed, you're asking Flash to forget what it
already knows as
"gotoAndStop" and, instead, run a custom function of the same
name.
This sort of thing is allowed if the function in question is
slated for
replacement in the original class file (here, the MovieClip
class). By
replacement, I mean that the function is question can
optionally be allowed
to be replaced, or overridden, at runtime.
Because the gotoAndStop() method is *not* marked for
override, you get
the 1024 message when you attempt to override it:
> 1024: Overriding a function that is not marked for
override.
So, the quickest way around this error is to come up with a
different
name for your btnPreschool event handler. How about
"jumpToFrame"?
btnPreschool.addEventListener (MouseEvent.CLICK,
jumpToFrame);
function jumpToFrame(evt:MouseEvent):void {
gotoAndStop("preschool");
};
David Stiller
Co-author, ActionScript 3.0 Quick Reference Guide
http://tinyurl.com/2s28a5
"Luck is the residue of good design."