If both swf's are on the same domain, you don't need to do anything special to 
get things working.

Have you tried simplifying things, like sending a simple text message from one 
swf to the other?


// sender swf

import mx.utils.Delegate;

function sendMessage() {
 trace("Sender ::: sendMessage");
 var sending_lc:LocalConnection = new LocalConnection();
 sending_lc.send("_myConnections", "setMedia", "Hello World");
}

play_button.onRelease = Delegate.create(this, this.sendMessage)



// reciever swf

import mx.utils.Delegate;

function setMedia(msg:String) {
    trace("Receiver ::: setMedia");
    trace(msg);
    // make sure there's a textfield on stage called message_txt
    this.message_txt.text += msg+"\n";
}

var receiving_lc:LocalConnection = new LocalConnection();
receiving_lc.setMedia = Delegate.create(this, this.setMedia);
receiving_lc.connect("_myConnections");



Start by running both swf's in the IDE, so you can see the trace output.
Once you got that working, try in a browser and see if the output is displayed 
in the textfield.

view example
http://muzakdeezign.com/downloads/localconn/

download example
http://muzakdeezign.com/downloads/localconn/localconn.zip

regards,
Muzak


----- Original Message ----- 
From: "Martin Scott Goldberg" <[EMAIL PROTECTED]>
To: <flashcoders@chattyfig.figleaf.com>
Sent: Saturday, October 28, 2006 5:57 AM
Subject: Re: [Flashcoders] LocalConnection and Media Components?


> Hi Ray, that didn't work either.  Changed the code to reflect those
> help pages as well, and that didn't work either.  Here's the sending code:
>
> play_button.onRelease = function()
> {
> var sending_lc:LocalConnection = new LocalConnection();
> sending_lc.send("_myConnections", "setMedia", "inmylife.mp3",
> "MP3");
> }
>
>
> Here's the recieving code:
>
> _root.my_display.associateController(my_controller);
> _root.my_controller.controllerPolicy = "on";
>
> var receiving_lc:LocalConnection = new LocalConnection();
> function setMedia(file:String, type:String){
>     _root.my_display.setMedia(file, type);
> }
> receiving_lc.allowDomain = function():Boolean {
>  return true;
> }
> receiving_lc.connect("_myConnections");
>
>
>
>
> This is getting really dissheartening that there's this much of a problem
> to do what should be a simple function.
>
>
>
> Marty


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to