Flash Photo Gallery PROBLEM!!!

cynthgrl

New Member
I have created a gallery in Flash and I keep getting this error in the output tab:


TypeError: Error #1009: Cannot access a property or method of a null object reference.
at gallery_fla::MainTimeline/frame1()[gallery_fla.MainTimeline::frame1:2]
at flash.display::MovieClip/gotoAndStop()
at gallery_fla::MainTimeline/play1()[gallery_fla.MainTimeline::frame1:4]

The below is my code, please tell me what I am doing wrong here!!
Thank you,


stop();
btn1a.addEventListener(MouseEvent.CLICK,play1);
function play1(event:MouseEvent):void{
gotoAndStop ("image1a")
}
btn2a.addEventListener(MouseEvent.CLICK,play2);
function play2(event:MouseEvent):void{
gotoAndStop ("image2a")
}
btn3a.addEventListener(MouseEvent.CLICK,play3);
function play3(event:MouseEvent):void{
gotoAndStop ("image3a")
}
btn4a.addEventListener(MouseEvent.CLICK,play4);
function play4(event:MouseEvent):void{
gotoAndStop ("image4a")
}
btn5a.addEventListener(MouseEvent.CLICK,play5);
function play5(event:MouseEvent):void{
gotoAndStop ("image5a")
}


btn6a.addEventListener(MouseEvent.CLICK,play6);
function play6(event:MouseEvent):void{
gotoAndStop ("image6a")
}
btn7a.addEventListener(MouseEvent.CLICK,play7);
function play7(event:MouseEvent):void{
gotoAndStop ("image7a")
}
btn8a.addEventListener(MouseEvent.CLICK,play8);
function play8(event:MouseEvent):void{
gotoAndStop ("image8a")
}
btn9a.addEventListener(MouseEvent.CLICK,play9);
function play9(event:MouseEvent):void{
gotoAndStop ("image9a")
}
btn10a.addEventListener(MouseEvent.CLICK,play10);
function play10(event:MouseEvent):void{
gotoAndStop ("image10a")
}
 

LouTheDesigner

New Member
First of all, including :void at the end of a function declaration in AS3 does absolutely nothing. get rid of it. Secondly all of your gotoAndStop() methods should be followed by a semi-colon.

Now, why are you using buttons? It is well established that MCs have all the functionality of buttons, plus more. So just about every symbol in your library should be a movie clip, not a button.

I don't think that following my advice alone will solve your problem, since your issue seems to come from some another AS file, or possibly a button that doesn't have the correct instance name. Actually, and probably more likely, it is due to the parameter in this line of code:

gotoAndStop ("image10a")

are you POSITIVE that image10a is the name of your label here? Is your label properly set?

Depending on the size of your .fla file, go ahead and send it to ([email protected])... Something tells me that it is not just your AS file that is causing this error.

-Lou
 
Top