Niassa
10-01-2007, 03:17 AM
First let me introduce myself. I'm Niassa and I'm pretty new to all of this. I did some basic Flash development way back in Flash 4, but didn't get into AS much at all. I have some basic OOP knowledge (C++, VB and a smidge of Java) so I'm not completely lost. This error I keep getting, however, is frustrating me like crazy, especially since I'm nearly copying it from a tutorial on this very thing (works great in the tut, not-so-much in my actual programming).
All I'm trying to do is basically get this movie clip to act as a button. When it is clicked I want it to go to the first frame of a different scene (in this instance it's the next scene, but I don't know that it will always be the next scene). I'm using the gotoAndStop function for this. The name of that frame is "Two" and the name of the scene is "Mid1." When I click on the movie clip, I get this error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Template01t_fla::MainTimeline/Template01t_fla::frame2()
Here is my code:
menuBtn_mc.buttonMode = true;
resourceBtn_mc.buttonMode = true;
nextBtn_mc.buttonMode = true;
exitBtn_mc.buttonMode = true;
menuBtn_mc.addEventListener(MouseEvent.MOUSE_OVER, menuRShow1);
menuBtn_mc.addEventListener(MouseEvent.MOUSE_OUT, menuRNoShow1);
resourceBtn_mc.addEventListener(MouseEvent.MOUSE_O VER, resourceRShow1);
resourceBtn_mc.addEventListener(MouseEvent.MOUSE_O UT, resourceRNoShow1);
nextBtn_mc.addEventListener(MouseEvent.MOUSE_OVER, nextRShow1);
nextBtn_mc.addEventListener(MouseEvent.MOUSE_OUT, nextRNoShow1);
nextBtn_mc.addEventListener(MouseEvent.CLICK, seeNext);
exitBtn_mc.addEventListener(MouseEvent.MOUSE_OVER, exitRShow1);
exitBtn_mc.addEventListener(MouseEvent.MOUSE_OUT, exitRNoShow1);
function seeNext(event:MouseEvent):void
{
gotoAndStop("Two","Mid1");
}
function menuRShow1(event:MouseEvent):void
{
menuRlvr_mc.alpha = 1;
}
function menuRNoShow1(event:MouseEvent):void
{
menuRlvr_mc.alpha = 0;
}
function resourceRShow1(event:MouseEvent):void
{
resourcesRlvr_mc.alpha = 1;
}
function resourceRNoShow1(event:MouseEvent):void
{
resourcesRlvr_mc.alpha = 0;
}
function nextRShow1(event:MouseEvent):void
{
nextRlvr_mc.alpha = 1;
}
function nextRNoShow1(event:MouseEvent):void
{
nextRlvr_mc.alpha = 0;
}
function exitRShow1(event:MouseEvent):void
{
exitRlvr_mc.alpha = 1;
}
function exitRNoShow1(event:MouseEvent):void
{
exitRlvr_mc.alpha = 0;
}
nextBtn_mc.gotoAndPlay("Two")
stop();
Everything else in the code works beautifully. Any help you all can provide would be so wonderfully appreciated.
All I'm trying to do is basically get this movie clip to act as a button. When it is clicked I want it to go to the first frame of a different scene (in this instance it's the next scene, but I don't know that it will always be the next scene). I'm using the gotoAndStop function for this. The name of that frame is "Two" and the name of the scene is "Mid1." When I click on the movie clip, I get this error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Template01t_fla::MainTimeline/Template01t_fla::frame2()
Here is my code:
menuBtn_mc.buttonMode = true;
resourceBtn_mc.buttonMode = true;
nextBtn_mc.buttonMode = true;
exitBtn_mc.buttonMode = true;
menuBtn_mc.addEventListener(MouseEvent.MOUSE_OVER, menuRShow1);
menuBtn_mc.addEventListener(MouseEvent.MOUSE_OUT, menuRNoShow1);
resourceBtn_mc.addEventListener(MouseEvent.MOUSE_O VER, resourceRShow1);
resourceBtn_mc.addEventListener(MouseEvent.MOUSE_O UT, resourceRNoShow1);
nextBtn_mc.addEventListener(MouseEvent.MOUSE_OVER, nextRShow1);
nextBtn_mc.addEventListener(MouseEvent.MOUSE_OUT, nextRNoShow1);
nextBtn_mc.addEventListener(MouseEvent.CLICK, seeNext);
exitBtn_mc.addEventListener(MouseEvent.MOUSE_OVER, exitRShow1);
exitBtn_mc.addEventListener(MouseEvent.MOUSE_OUT, exitRNoShow1);
function seeNext(event:MouseEvent):void
{
gotoAndStop("Two","Mid1");
}
function menuRShow1(event:MouseEvent):void
{
menuRlvr_mc.alpha = 1;
}
function menuRNoShow1(event:MouseEvent):void
{
menuRlvr_mc.alpha = 0;
}
function resourceRShow1(event:MouseEvent):void
{
resourcesRlvr_mc.alpha = 1;
}
function resourceRNoShow1(event:MouseEvent):void
{
resourcesRlvr_mc.alpha = 0;
}
function nextRShow1(event:MouseEvent):void
{
nextRlvr_mc.alpha = 1;
}
function nextRNoShow1(event:MouseEvent):void
{
nextRlvr_mc.alpha = 0;
}
function exitRShow1(event:MouseEvent):void
{
exitRlvr_mc.alpha = 1;
}
function exitRNoShow1(event:MouseEvent):void
{
exitRlvr_mc.alpha = 0;
}
nextBtn_mc.gotoAndPlay("Two")
stop();
Everything else in the code works beautifully. Any help you all can provide would be so wonderfully appreciated.