03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

};<br />

my_sound.loadSound(mp3Path, true);<br />

};<br />

receiving_lc.connect("lc_name");<br />

SWF 2 contains a button called play_btn. When you click the button, it connects to SWF 1<br />

<strong>and</strong> passes two variables. The first variable contains the MP3 file to stream, <strong>and</strong> the second<br />

variable is the filename that you display in the Label component instance in SWF 1.<br />

play_btn.onRelease = function() {<br />

var sending_lc:LocalConnection = new LocalConnection();<br />

sending_lc.send("lc_name", "playMP3", "song1.mp3", "Album - 01 - Song");<br />

};<br />

SWF 3 contains a button called play_btn. When you click the button, it connects to SWF 1<br />

<strong>and</strong> passes two variables. The first variable contains the MP3 file to stream, <strong>and</strong> the second<br />

variable is the filename that you display in the Label component instance in SWF 1.<br />

play_btn.onRelease = function() {<br />

var sending_lc:LocalConnection = new LocalConnection();<br />

sending_lc.send("lc_name", "playMP3", "song2.mp3", "Album - 02 - Another<br />

Song");<br />

};<br />

The MovieClip.getNextHighestDepth() method used in these examples requires Flash<br />

Player 7 or later. If your SWF file includes a version 2 component, use the version 2<br />

components' DepthManager class instead of the MovieClip.getNextHighestDepth()<br />

method.<br />

See also<br />

send (LocalConnection.send method), allowDomain (LocalConnection.allowDomain<br />

h<strong>and</strong>ler), domain (LocalConnection.domain method)<br />

domain (LocalConnection.domain method)<br />

public domain() : String<br />

Returns a string representing the domain of the location of the current SWF file.<br />

In SWF files published for Flash Player 6, the returned string is the superdomain of the<br />

current SWF file. For example, if the SWF file is located at www.adobe.com, this comm<strong>and</strong><br />

returns "adobe.com".<br />

In SWF files published for Flash Player 7 or later, the returned string is the exact domain of<br />

the current SWF file. For example, if the SWF file is located at www.adobe.com, this<br />

comm<strong>and</strong> returns "www.adobe.com".<br />

If the current SWF file is a local file residing on the client computer, this comm<strong>and</strong> returns<br />

"localhost".<br />

LocalConnection 731

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!