TypeErrors are persistent little buggers, aren't they?
To fully understand what the problem is, it may help to go back to before I amended my working version with a new one.
You see, I had my preloader which worked and the intro all out under seperate layers on the main Timeline. A friend recommended that instead of grouping all those layers and wasting space on the main timeline, all the elements should be under "categorised movieclips". In simplier terms, the Preloader would be one big movie clip, containing all the secondary clips like the actual loader, the mask which reveals the loading bar, etc and the Intro would be one big movie clip, which contained all the secondary movie clips for that function. Getting the picture? The problems started when I interfered with the balance and adopted this approach.
After playing around with it today, I'm starting to see where the problem lies. Basically, the function which should run when the preloader has loaded all the content tells Flash to go back into the Main Timeline (parent) and start playing the second frame (which is where the intro clip is). Flash then reports back that there's nothing in Frame 2 to play, so skips straight to frame 3 and pulls up the TypeError #1009. This was my initial thought and led to an indication that something within the Actionscript code for the preloader is going wrong.
Now, I can't post the full code due to the fact that the University's Plagarism bot will most likely pull it up and start putting flags in my work, hampering or even seriously damaging my grade. I can only post small (really small) snippits.
The preloader has a "loading" condition, which executes a function where the data is being loaded, and a "Complete" condition, which executes a function when all the content is loaded. The error was specifically pointing to the "Complete" function, which only had one line of code. [ MovieClip(parent).gotoAndStop(2) ] and then skipping the intro clip after pulling the error.
After a while, I figured out that, by mistake, I omitted a stop action in the second frame of the main timeline. So what was happening was I was telling Flash to go to frame 2 and play whatever was there. Without the stop action, Flash was effectively ignoring the frame, acting as if it didn't exist. Conflict in interests really.
In other terms:
Code> Please go to Frame 2 in the parent Timeline after preloading and do whatever function is located there.
-Preload-
-Frame 2 skipped, jumps to Frame 3-
Flash> Frame 2? That doesn't exist. Your referencing me to play a non existent frame
Once I put in the stop action on the second frame, the Intro clip played after the preloader, however, the TypeError still popped up, meaning that the omitted stop action was not infact causing the null object reference.
What could it be?
I asked for a second opion from a friend who seemingly fixed the error but didn't excatly know what was causing it. He had an idea, but when I amended that, it still brought up the problem.
I went back into the Loader's Actionscript to figure out why. My friend sent back the amended file which I contrasted with the broken one.
I found the problem.
Turns out using 'MovieClip(parent).gotoAndStop (or gotoAndPlay)' method in preloaders isn't a good way to achieve what I was after. Flash pretty much had no idea what excatly I was trying to reference using that code so brought up the error. My friend had decided to replace it with a nextFrame method instead which did the job and got rid of the error.
It means at the end of the intro clip I had to declare a new variable which would treat the parent timeline as a movie clip, something I probably should of done before declaring such a method in the first place.
Novice mistake, but mistakes are the key in learning. You don't forget the mistakes you make, and try ot think of ways to avoid making that same error in the future.
But I'm just glad it's fixed. Major props to my friend on that front.
So for the end of today, I would like to make the final animations for the introduction and the User-Clickable "Door" to enter the site. Maybe do some animation clean ups to make everything look smoother and some final testing to make sure all the errors are properly ironed out.
Tomorrow, I aim to start making the main menu, buttons, layout, pages and page transistions (more animations).
Saturday will hopefully be the page content and Sunday will hopefully bring forth the beginning of the creation of the application. Gives me a bit of time to decide on what I'm going to do for interactivity and the approach to take with the app altogether.
I'm aiming for the Website and Program to be completed, compiled, ironed out for bugs, amended, licked, sealed, approved, stamped and whatever else by at least Wednesday 24th November 2010. Then, I aim to complete all documentation (Project Plan, Specification, Creation Procress, Hand Sketches and Storyboards (finalisations)) by Monday 29th November 2010. There's also a size limitation of 16MB which, in my opinion, is ridiculous for such a document, feature heavy assignment. However, those are the rules and they have to be followed.
After that, comes Video Editing and DVD Authoring in Premiere Pro for a second assignment, due on the 16th of December.
My brain is slowly shutting off just thinking about all the work that needs to be done.