0 Replies - 3454 Views - Last Post: 24 April 2013 - 04:16 PM

#1 ungraphic  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 01-April 12

Multiple Links

Posted 24 April 2013 - 04:16 PM

I'm trying to make three buttons fade in one after another, with each button having its own link (client logos being displayed on a webpage directing them to their own site).

This is my code:

button1.addEventListener(MouseEvent.CLICK, button1Click);
button2.addEventListener(MouseEvent.CLICK, button2Click);
button3.addEventListener(MouseEvent.CLICK, button3Click);

function button1Click(event:MouseEvent) :void
	navigateToURL(new  URLRequest("http://www.button1.com"), "_blank");
	trace("I'm clicked");

function button2Click(event:MouseEvent) :void
	navigateToURL(new  URLRequest("http://www.button2.com/"), "_blank");
	trace("I'm clicked");

function button3Click(event:MouseEvent) :void
	navigateToURL(new  URLRequest("http://www.button3.com/"), "_blank");
	trace("I'm clicked");

This is the error I'm getting;


TypeError: Error #1009: Cannot access a property or method of a null object reference.
at sponsors_fla::MainTimeline/frame1()

When I run the flash file, it does NOT play, its stuck at frame 1. I've made sure that every object on the timeline has an instance name. If I remove the code that applies to the other two buttons, it plays fine and the first button works, but not the rest.

What is wrong with Flash? Any help?

Thanks in advance!

Is This A Good Question/Topic? 0
  • +

Page 1 of 1