Jump to content


Photo

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


  • Please log in to reply
2 replies to this topic

#1 pomp

pomp

    Young Padawan

  • Members
  • Pip
  • 1 posts

Posted 21 January 2009 - 03:43 PM

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

#2 austen

austen

    P2L Jedi

  • Members
  • PipPipPip
  • 910 posts
  • Location:Montana, US
  • Interests:Web design, snowboarding (lots of it), Computer science related.

Posted 21 January 2009 - 07:09 PM

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:

navigateToURL(urlRequestVariable, "_self");

play with it, if you can't figure it out, email the fla file to [email protected]. I'll fix it and tell you exactly what was wrong.

-austen :)

#3 The_Mexican

The_Mexican

    Young Padawan

  • Members
  • Pip
  • 2 posts

Posted 03 March 2009 - 04:39 PM

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***//
<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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users