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
TypeError: Error #1009: Cannot access a property or method of a null object reference.
Started by
pomp
, Jan 21 2009 03:43 PM
2 replies to this topic
#1
Posted 21 January 2009 - 03:43 PM
#2
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:
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
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
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***//
Can you please assist me?
Thanks,
-Roy
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
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users