I am designing a flash swf file, which is used to test video connection setting in Flash Media Server. The IP address of the Flash Media Server should be passed from Javascript in SWFobject to the actionscript in the flash file. My Javascript for SWFobject:
<div id="flashContent" class="flashContainer"></div>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
var so = new SWFObject("/_swf/fms_connection/settings.swf", "connection_settings", "640", "360","7");
so.addParam("wmode", "transparent");
so.addParam("flashvars", "fms_server=192.168.1.61&room_id='.$_SESSION['member_id'].'");
so.write("flashContent");
//--><!]]>
</script>
Pass variables room_id and fms_server to the actionscript in the flash file.
import flash.external.
function onMouseDown():Void {
focusManager.enabled = false;
}
function onMouseUp():Void {
focusManager.enabled = true;
}
attachMovie("
var flash_id = "connection_settings"; //could retrive this dynamically with the _url param
function whereAmI(myLocation:String):
cs.myTrace("whereAmI: " + myLocation);
cs.connect(room_id,myLocation,
}
//don't put the swf in a form IE will crap out on ExternalInterface.addCallback
ExternalInterface.addCallback(
getURL("javascript:var me=document."+flash_id+";me.
room_id and fms_serve are also passed to connetionSettings class, which is defined in another actionscript file.
No comments:
Post a Comment