# Email Link

**URL:** <https://forum.kirupa.com/t/email-link/277603>\
**Category:** Uncategorized\
**Created:** [December 14, 2008, 6:56pm UTC](https://forum.kirupa.com/t/email-link/277603 "2008-12-14T18:56:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jp1239](https://avatars.discourse-cdn.com/v4/letter/j/ad7895/32.png) [@jp1239](https://forum.kirupa.com/u/jp1239)\
**Post date:** [December 14, 2008, 6:56pm UTC](https://forum.kirupa.com/t/email-link/277603/1 "2008-12-14T18:56:04Z")

</div>

I am new to action script 3.0 and I am trying to build a site. I have a contact button on the site that leads to a contacts page where I have provided emails that you can click on to email that person. However I have written the code for it and it only works if the link is on the home page but it doesn’t work if I have it on the contact page. I need help with this. Here is my code. It keeps giving me a TypeError: Error #1009: Cannot access a property or method of a null object reference. MainTimeline/frame1()[Omega\_Seminars\_fla.MainTimeline::frame1:15]

var loisMail\_req:URLRequest = new URLRequest("mailto:address@somewhere.net");

contact\_btn.addEventListener(MouseEvent.CLICK, contact);  
function contact(event:MouseEvent):void  
{  
gotoAndPlay(“Contact”);  
}

mail.addEventListener(MouseEvent.CLICK, mailLink);  
function mailLink(event:MouseEvent):void  
{  
navigateToURL(loisMail\_req, “\_blank”);  
}
