Using Macromedia Flash
You may access all WACP RPCs using HTTP post. In Flash, you may accomplish this using LoadVars{}
and sendAndLoad(). An example for making these calls follows.
STEP 1: Pass WACI IP Address to Flash
To begin, you must pass the IP address of WACI to your Flash file. There is more than one way to do
this, but below, we describe one sample method using JavaScript. NOTE: In this script, the .html and
.swf files must reside on the WACI to determine the IP address.
First, at the top of the .html file in which you are embedding your flash file (here, the name of the file is
“MyWACIShockWaveFlashFile.swf”), insert this bit of script:
<script type=“text/javascript” language=“JavaScript”>
thispage = location.href;
URLarr = thispage.split(“/”);
theIP = URLarr[2];
theFILE = “MyWACIShockWaveFlashFile.swf”;
</script>
Next, use this bit of script to embed the flash file in the desired area of the web page:
<script type=“text/javascript” language=“JavaScript”>
document.write('<object id=“WACI” classid=“clsid:D27CDB6E-
AE6D-11cf-96B8-444553540000”
codebase=“http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.
cab#version=6,0,29,0” width=“100%” height=“100%”>');
document.write('<param name=“movie” value=“'+'“
/>');
document.write('<param name=“quality” value=“high” />');
document.write('<param name=“FlashVars”
value=“callerID='+theIP+'“ />');
document.write('<embed name=“flashMovie” src=“'+'“
FlashVars=“callerID='+theIP+'“ quality=“high”
pluginspage=“http://www.macromedia.com/go/getflashplayer”
type=“application/x-shockwave-flash” width=“100%” height=“100%”></embed>');
document.write('</object>');
</script>
The IP Address may now be accessed from your Flash action scripts in the Variable “
callerID
”.