Help - Search - Members - Calendar
Full Version: TypeError: Error #1009: Cannot access a property or method of a null object reference.
Pixel2Life Forum > Help Section > Adobe Flash
pomp
i keep getting this error no matter how i change the code. i am simply trying to make an animated button that links to an external website.

TypeError: Error #1009: Cannot access a property or method of a null object reference.

here is my as3 code

var link:URLRequest = new URLRequest("http://www.adobe.com");
pure.addEventListener(MouseEvent.CLICK, onClick);
function onClick(event:MouseEvent):void {
navigateToURL(link);
}

thanks in advance for any help
austen
do you have pure defined as a movieclip instance?

This type of error means you're trying to use a variable that is not defined. Also you should probably specify which window to use for navigateToURL. like this:

CODE
navigateToURL(urlRequestVariable, "_self");


play with it, if you can't figure it out, email the fla file to austen.cameron@gmail.com. I'll fix it and tell you exactly what was wrong.

-austen victory.gif
The_Mexican
Hi-

I'm having the same problem.

I have a preloader.swf file that when loading is complete the Portfolio.swf page displays. I have attached the Portfolio.fla to a file called MyContent.as.

I still don't know which code to fix; is it the MyContent.as file or the preloader.fla file? And what should I be writing to get rid of this error?


//***preloader.fla***//
CODE
<span class="value">var l:Loader = new Loader();
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
l.load(new URLRequest("Portfolio.swf"));

function loop(event:ProgressEvent):void
{
     var perc:Number = event.bytesLoaded / event.bytesTotal;
     percent.text = Math.ceil(perc*100).toString();
}

function done(event:Event):void
{
     removeChildAt(0);
     percent = null;
     addChild(l);
}
</span>


Can you please assist me?

Thanks,

-Roy
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.