User Guide

722 ActionScript classes
SWF 2 contains a button called play_btn. When you click the button, it connects to SWF 1
and passes two variables. The first variable contains the MP3 file to stream, and the second
variable is the filename that you display in the Label component instance in SWF 1.
play_btn.onRelease = function() {
var sending_lc:LocalConnection = new LocalConnection();
sending_lc.send("lc_name", "playMP3", "song1.mp3", "Album - 01 - Song");
};
SWF 3 contains a button called play_btn. When you click the button, it connects to SWF 1
and passes two variables. The first variable contains the MP3 file to stream, and the second
variable is the filename that you display in the Label component instance in SWF 1.
play_btn.onRelease = function() {
var sending_lc:LocalConnection = new LocalConnection();
sending_lc.send("lc_name", "playMP3", "song2.mp3", "Album - 02 - Another
Song");
};
The MovieClip.getNextHighestDepth() method used in these examples requires Flash
Player 7 or later. If your SWF file includes a version 2 component, use the version 2
components DepthManager class instead of the
MovieClip.getNextHighestDepth()
method.
See also
send (LocalConnection.send method), allowDomain (LocalConnection.allowDomain
handler)
, domain (LocalConnection.domain method)
domain (LocalConnection.domain method)
public domain() : String
Returns a string representing the domain of the location of the current SWF file.
In SWF files published for Flash Player 6, the returned string is the superdomain of the
current SWF file. For example, if the SWF file is located at www.macromedia.com, this
command returns
"macromedia.com".
In SWF files published for Flash Player 7 or later, the returned string is the exact domain of
the current SWF file. For example, if the SWF file is located at www.macromedia.com, this
command returns
"www.macromedia.com".
If the current SWF file is a local file residing on the client computer, this command returns
"localhost".