Error #1009: Cannot access a property or method of a null object reference.
Hello -
Hoping someone can help me out. This is for a banner ad. Everything was working perfect until I added an invisible button to the first 315 frames and added the Link_1 clickTag code. We use an ad server so I have to use the clickTag code that they provided for each external link. I am not sure why it worked just fine before I added in the invisible button and now it does not. I am wondering if the Fire Animation movie (see AS3 down below) is somehow comflicting with the button being overtop of it?
I used the Debugger and it says:
Scene/Symbol Layer Frame
Scene 1 AS3 450
#MAIN_FIRE_CONTAINER ActionScript 1
single_fire_animation SingleFire 35
Here is my main AS3 on the main timeline - last frame (frame 450)
stop();
Link_1.addEventListener(MouseEvent.MOUSE_UP, function(event: MouseEvent): void {
var sURL: String;
if ((sURL = root.loaderInfo.parameters.clickTag)) {
navigateToURL(new URLRequest(sURL), "_blank");
}
});
Link_2.addEventListener(MouseEvent.MOUSE_UP, function(event: MouseEvent): void {
var sURL: String;
if ((sURL = root.loaderInfo.parameters.clickTag)) {
navigateToURL(new URLRequest(sURL), "_blank");
}
});
Link_3.addEventListener(MouseEvent.MOUSE_UP, function(event: MouseEvent): void {
var sURL: String;
if ((sURL = root.loaderInfo.parameters.clickTag)) {
navigateToURL(new URLRequest(sURL), "_blank");
}
});
Link_4.addEventListener(MouseEvent.MOUSE_UP, function(event: MouseEvent): void {
var sURL: String;
if ((sURL = root.loaderInfo.parameters.clickTag)) {
navigateToURL(new URLRequest(sURL), "_blank");
}
});
Link_5.addEventListener(MouseEvent.MOUSE_UP, function(event: MouseEvent): void {
var sURL: String;
if ((sURL = root.loaderInfo.parameters.clickTag)) {
navigateToURL(new URLRequest(sURL), "_blank");
}
});
legal.addEventListener(MouseEvent.CLICK, clickFunction);
function clickFunction(evt:MouseEvent):void {
gotoAndStop(341);
}
replay.addEventListener(MouseEvent.CLICK, onClick);
function onClick(event:MouseEvent):void
{
gotoAndPlay(1); // plays the current timeline from 1
} // end of onClick
Here is the AS3 for the Fire Animation
var nr:Number = 0;
var $mc:MovieClip;
this.addEventListener(Event.ENTER_FRAME, enterHandler);
function enterHandler (evt:Event):void{
if(nr < 100)
{
$mc = new Fire(); //assumes you have a movie clip with a class name of "Fire" set to export for AS
$mc.x = (Math.random()*4)-2;
$mc.scaleY = 0.80;
$mc.rotation = (Math.random()*2)-1;
Math.random()*2 > 1 ? $mc.scaleX = 0.80:$mc.scaleX = -0.80;
this.addChild($mc);
nr++;
} else {
nr = 0;
}
}
Any help is greatly appreciated!!!!
Thank you!