I have created a button using flash Pro cc I've been doing research but was unable to find why a TypeError stating
TypeError: Error #1009: Cannot access a property or method of a null object reference.at PD3Subscribenow_fla::MainTimeline/frame1()
I have placed my code on a action layer on frame 1:
import flash.events.MouseEvent;
sub_btn.addEventListener(MouseEvent.CLICK, myButtonFunction);
function myButtonFunction(event: MouseEvent) {
var request:URLRequest = new URLRequest("http//:www.google.com");
navigateToURL(request, "_blank");
}
and gave the instance name of my button "sub_btn".
Can you tell me where I have gone wrong.
sub_btn
is null. are you sure it's available on frame 1 with that instance name? – BadFeelingAboutThis