# Please help me attaching multiple url links to my flash project!

**URL:** <https://forum.kirupa.com/t/please-help-me-attaching-multiple-url-links-to-my-flash-project/287108>\
**Category:** flash\
**Created:** [April 26, 2009, 3:08pm UTC](https://forum.kirupa.com/t/please-help-me-attaching-multiple-url-links-to-my-flash-project/287108 "2009-04-26T15:08:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yiaggi](https://avatars.discourse-cdn.com/v4/letter/y/48db29/32.png) [@yiaggi](https://forum.kirupa.com/u/yiaggi)\
**Post date:** [April 26, 2009, 3:08pm UTC](https://forum.kirupa.com/t/please-help-me-attaching-multiple-url-links-to-my-flash-project/287108/1 "2009-04-26T15:08:23Z")

</div>

Hi guys,

I have a very simple flash project that I need to be completed tommorow or my head is in the block! I am new to Flash and Actionscript but work well with PHP so do have some idea of what I am doing but, this has left me stumped and in trouble if I don’t get it done!

Basically my movie is very simple. I have a background and after a short break my first scene flys on with one link then leaves - then the second with a different link, then the third.

I converted all links to buttons and gave them instance names ‘button1\_btn’, button2\_btn’ and ‘button3\_btn’ and then added my new layer for the action script.

Below is the actionscript I used to make the buttons work:

**var buttons:Array = [button1\_btn, button2\_btn, button3\_btn];  
var urls:Array = ["**[**http://mywebsite.com **\*\*",** [URL=“http://mywebsite.com”]**[URL=“http://mywebsite.com/subsciptions”]http://mywebsite.com\*\*/subsciptions\*\*, "\*\*[URL=“http://mywebsite.com/archive”]**http://mywebsite.com/archive**](http://mywebsite.com)**"];  
for (var i:int = 0; i \< buttons.length; i++) {  
buttons\*.addEventListener(MouseEvent.CLICK, buttonClicked);  
}  
function buttonClicked(event:MouseEvent):void {  
for (var i:int = 0; i \< buttons.length; i++) {  
if (event.currentTarget == buttons\*) {  
navigateToURL(new URLRequest(urls\*));  
}  
}  
}**

When I try to preview this in an HTML browser - all I get is my blank background scene with no animation.

When I try to preview in Flash I get this error message:

**TypeError: Error #1009: Cannot access a property or method of a null object reference. at banner\_new\_fla::MainTimeline/frame1()**

I can’t see anything one with ‘frame1’ as it refers to!

I’m really confused and have spent hours on google etc tring to find the solution. All I have got is different codes that I have tried and had similar results. The best I can achieve is to get one button working or the whole animation playing but no buttons working!

I have to have this fiished in the next 2 hours so am in the s\*\*t! If anyon could help it would be truly appreciated!

Thanks in advance.

🙂
