Hi, so I’ve read through all the other forums trying to figure this out, getting error in output
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at testweb_fla::MainTimeline/mouseDownHandler3()
swf loads main page, there are 4 buttons, they are linked to frame labels for content, it throws this error when I hit 3/4 buttons, the 4th button (menu) goes to the right frame and loads jpg menu image, when I hit any of the other three buttons after hitting the menu button they work perfectly, its only after i hit the 1 button that enables me to navigate to the other pages.
import flash.events.MouseEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.display.Loader;
import flash.display.SimpleButton;
stop();
cnut1.buttonMode = true;
cnut1.addEventListener(MouseEvent.CLICK, onButtonClick1);
function onButtonClick1(e:MouseEvent):void
{
e.currentTarget.gotoAndPlay(“Click”);
}
Home.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler1);
function mouseDownHandler1(event:MouseEvent):void
{
imageLoader1.unload();
imageLoader2.unload();
gotoAndStop("Home");
}
Media.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler2);
function mouseDownHandler2(event:MouseEvent):void
{
imageLoader1.unload();
imageLoader2.unload();
gotoAndStop("Media");
}
Faq.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler3);
function mouseDownHandler3(event:MouseEvent):void
{
imageLoader1.unload();
imageLoader2.unload();
gotoAndStop("FAQ");
}
Men.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler4);
function mouseDownHandler4(event:MouseEvent):void
{
gotoAndStop("Menu");
}
and then on a different layer at frame 5-10 label “Menu”
var imageLoader1:Loader = new Loader();
var image1:URLRequest = new URLRequest(“coconut1.jpg”)
imageLoader1.load(image1);
addChild(imageLoader1);
imageLoader1.x=425;
imageLoader1.y=110;
var imageLoader2:Loader = new Loader();
var image2:URLRequest = new URLRequest(“coconut2.jpg”)
var imageLoader3:Loader = new Loader();
var image3:URLRequest = new URLRequest(“coconut3.jpg”)
btnM1.addEventListener(MouseEvent.CLICK, nextMenu);
function nextMenu (MouseEvent):void
{
imageLoader2.load(image2);
addChild(imageLoader2);
imageLoader2.x=425;
imageLoader2.y=110;
}
btnM2.addEventListener(MouseEvent.CLICK, nextMenu1)
function nextMenu1(event:MouseEvent):void
{
imageLoader3.load(image3);
addChild(imageLoader3);
imageLoader3.x=425;
imageLoader3.y=110;
}
any help would be most appreciated, thanks.