Copy link to clipboard
Copied
I am follwoing a tutorial on linda.com about creating a website in Flash
everything was going well until i started trying to copy the action script in the online examples
now I keep getting this error message and can't figure out how to get rid of it:
1026: Constructor functions must be instance methods.
any assistance wouold be much appreciated, thank you
here is the action script I am using for my buttons:
stop();
tv.addEventListener(MouseEvent.CLICK, clickSection);
function clickSection(evtObj:MouseEvent){
gotoAndStop("tv");
}
Copy link to clipboard
Copied
what makes you think the error message is related to that code?
Copy link to clipboard
Copied
Maybe it is not related to the actionscript, any ideas?
Copy link to clipboard
Copied
Looks like you are using some class that has constructor nested into another function.
Most probably you have function on timeline of a library symbol that has the same name as a class that is assigned to it.
Copy link to clipboard
Copied
I am still getting the error message...
Any suggestions, the Flash file is attached
Thank you
Date: Sun, 18 Jul 2010 22:09:14 -0600
From: forums@adobe.com
To: chisholmrichard@hotmail.com
Subject: error: 1026: Constructor functions must be instance methods.
Looks like you are using some class that has constructor nested into another function.
Most probably you have function on timeline of a library symbol that has the same name as a class that is assigned to it.
>
Copy link to clipboard
Copied
Files cannot be attached any longer to the posts. In any case, you need to show code and explain what is going on in your symbols in terms of classes and function names.
Copy link to clipboard
Copied
I'm sorry, I am still not following what you are saying
here is what I have in the actions layer, frame 1
stop();
tv.addEventListener(MouseEvent.CLICK, clickSection);
anim.addEventListener(MouseEvent.CLICK, clickSection);
ads.addEventListener(MouseEvent.CLICK, clickSection);
photo.addEventListener(MouseEvent.CLICK, clickSection);
film.addEventListener(MouseEvent.CLICK, clickSection);
home.addEventListener(MouseEvent.CLICK, clickSection);
function clickSection(evtObj:MouseEvent){
trace ("The "+evtObj.target.name+" button was clicked!")
gotoAndStop(evtObj.target.name);
}
I am trying to link markers on the actions time line: tv, anim, ads, photo, film and home
with layers (web pages) on the time line below...
Copy link to clipboard
Copied
Enable debugging in publish settings and post entire error with line number.