Copy link to clipboard
Copied
Hi everyone,
I'm having an absolute nightmare with my current project (a Flash game) just now as I keep getting the above error. With a bit of rooting around it seems that it is being caused by my one of my MovieClips - a simple mc containing a set of tutorial pages on how to play the game. I've googled the error but keep finding conflicting 'causes' none of which seem to apply to my project. If I remove this movieclip from my code the project works fine, so the issue is definitely coming from it.
One possible cause of this error I read was 'annonymous' functions on the timeline. Now I'm not entirely sure what an annonymous function is, but I have since commented out ALL of my timeline code with the exception of a stop() command in each keyframe. I don't usually code on the timeline at all because I think it's messy, this was just a one off. Either way, it made no difference whatsoever.
Does anyone have any idea what could be causing this error? Everything contained in this mc with the exception to a few text boxes is used elsewhere in the project so I really can't understand why it's causing issues here. I've been stuck now for about a day and a half and I'm running out of time to get this fixed. Any ideas would be greatly appreciated.
replace that button with one that looks the same.
Copy link to clipboard
Copied
for runtime errors you can use either the trace() function to pinpoint the the first line with that error or, better yet, comment code (/* - */) to pinpoint the exact line(s) of code triggering the error. have you done that? if yes, what are the lines? if not, do that.
Copy link to clipboard
Copied
The error is occuring as soon as I call the constructor for the class. I haven't actually written a class for it so it's crashing when it calls the default constructor created for it by Flash.
Other than the stop(); commands on each keyframe I have written absolutely no other code for it.
Oh I don't know if it makes a difference, but I started having the problem ever since I started trying to follow this tutorial :
http://asgamer.com/2009/making-a-complete-flash-game-creating-understanding-the-preloader
and I changed everything to not export on the first frame, but instead have everything in a MovieClip on frame 2 as described here.
Copy link to clipboard
Copied
Here is the exact output relating to the error message
at flash.display::Sprite/constructChildren()
at flash.display::Sprite()
at flash.display::MovieClip()
at HowToPlaySection()
at MainMenu()[/Users/Morgenstern/Documents/FlashandActionScript/Suckabees/MainMenu.as:87]
That line (87) is where the HowToPlaySection constructor is called.
Copy link to clipboard
Copied
I've narrowed it down futher - it has taken a dislike to a single instance of a CloseButton movieclip that is present in the HowToPlaySection MovieClip. Now this exact same CloseButton movieclip is used in at least 5 other places around my program without fault, but here it does not like it 😕
If I remove it and replace it with any random movieclip (with the same instance name) the code works fine again, no errors. I can see no problem with the CloseButton mc - it is just a simple movieclip with four frames titled as they would be in an instance of the button class (_up, _over, _down, _hit) and it's buttonMode property set to true.
Copy link to clipboard
Copied
replace that button with one that looks the same.
Copy link to clipboard
Copied
Right so I've made a NewCloseButton class and am now not getting that error, even though it is a complete clone of CloseButton? What on earth is going on???
Only strange thing that's going on now is that the instance of NewCloseButton will NOT function as a button, despite button mode being set to true and it having all the necessary _up, _down, etc frames
Copy link to clipboard
Copied
something was probably corrupted in that button.
anyway, add your code to make your button function. if you have added your code, use the trace() function to debug.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now