# LocalConnection first timer

**URL:** <https://forum.kirupa.com/t/localconnection-first-timer/257243>\
**Category:** Uncategorized\
**Created:** [April 11, 2008, 4:37pm UTC](https://forum.kirupa.com/t/localconnection-first-timer/257243 "2008-04-11T16:37:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jfoley](https://avatars.discourse-cdn.com/v4/letter/j/838e76/32.png) [@jfoley](https://forum.kirupa.com/u/jfoley)\
**Post date:** [April 11, 2008, 4:37pm UTC](https://forum.kirupa.com/t/localconnection-first-timer/257243/1 "2008-04-11T16:37:42Z")

</div>

I am trying to use LocalConnection to set up an mp3 player that is broken into two parts of a web page. One swf has the controls and the other plays the track / displays spectrum. This is my first time trying to set this up so I’m doing a simple test.  
Here is my code:  
**Receiver**

```auto
import flash.net.LocalConnection;
var conn:LocalConnection = new LocalConnection();
conn.connect("sendData");
function trackData(msg:String):void
{
 textData.text = msg;
}

```

**Sender**

```auto
import flash.net.LocalConnection;
var conn:LocalConnection = new LocalConnection();
sender.addEventListener(MouseEvent.CLICK, onClick);
function onClick(e:MouseEvent):void
{
 conn.send("sendData", "trackData", "Message Sent");
}

```

Any idea what I’m doing wrong?
