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
import flash.net.LocalConnection;
var conn:LocalConnection = new LocalConnection();
conn.connect("sendData");
function trackData(msg:String):void
{
textData.text = msg;
}
Sender
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?