作者:刘毅 www.ourbrander.com
AS:
import flash.external.*
mm.onPress = function ()
{
tt.text = flash.external.ExternalInterface.call("getURL", "aa");
};
js:
function getURL(){
var url=document.URL
return url
}
发布时 HTML那里请选择带FSCOMMAND的
下面是例子:
---------------------------------------------------------------------------------------
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>myFlash</title>
<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="AC_RunActiveContent.js" language="javascript"></script>
</head>
<body bgcolor="#ffffff">
<!--url’s used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<script language="JavaScript">
<!--
function setURL(id){
var hs=document.location.hash
if(hs==null || hs=="" ||hs=="#"){
document.location.hash=id
}else{
document.location.hash=id
}
return document.url
}
//end function
function delURL(){
document.location.hash=""
}
//end function
function readURL(){
var all_value=new Array()
var all_data=new String(document.location.hash)
all_data=all_data.slice(1)
return all_data
document.write(all_data)
}
//end function
function getURL(){
var url=document.URL
return url
}
// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
document.write(’<script language=/"VBScript/"/>/n’);
document.write(’On Error Resume Next/n’);
document.write(’Sub myFlash_FSCommand(ByVal command, ByVal args)/n’);
document.write(’ Call myFlash_DoFSCommand(command, args)/n’);
document.write(’End Sub/n’);
document.write(’</script/>/n’);
}
//-->
</script>
<script language="javascript">
if (AC_FL_RunContent == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
AC_FL_RunContent( ’codebase’,’http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0’,’name’,’myFlash’,’width’,’550’,’height’,’400’,’align’,’middle’,’id’,’myFlash’,’src’,’geturl’,’quality’,’high’,’bgcolor’,’#ffffff’,’allowscriptaccess’,’sameDomain’,’allowfullscreen’,’false’,’pluginspage’,’http://www.macromedia.com/go/getflashplayer’,’movie’,’geturl?’+readURL() ); //end AC code
}
</script>
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" name="myFlash" width="550" height="400" align="middle" id="myFlash">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="geturl.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /> <embed src="geturl.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="myFlash" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</noscript>
</body>
</html>
AS:
import flash.external.*
mm.onPress = function ()
{
tt.text = flash.external.ExternalInterface.call("getURL", "aa");
};
js:
function getURL(){
var url=document.URL
return url
}
发布时 HTML那里请选择带FSCOMMAND的
下面是例子:
---------------------------------------------------------------------------------------
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>myFlash</title>
<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="AC_RunActiveContent.js" language="javascript"></script>
</head>
<body bgcolor="#ffffff">
<!--url’s used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<script language="JavaScript">
<!--
function setURL(id){
var hs=document.location.hash
if(hs==null || hs=="" ||hs=="#"){
document.location.hash=id
}else{
document.location.hash=id
}
return document.url
}
//end function
function delURL(){
document.location.hash=""
}
//end function
function readURL(){
var all_value=new Array()
var all_data=new String(document.location.hash)
all_data=all_data.slice(1)
return all_data
document.write(all_data)
}
//end function
function getURL(){
var url=document.URL
return url
}
// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
document.write(’<script language=/"VBScript/"/>/n’);
document.write(’On Error Resume Next/n’);
document.write(’Sub myFlash_FSCommand(ByVal command, ByVal args)/n’);
document.write(’ Call myFlash_DoFSCommand(command, args)/n’);
document.write(’End Sub/n’);
document.write(’</script/>/n’);
}
//-->
</script>
<script language="javascript">
if (AC_FL_RunContent == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
AC_FL_RunContent( ’codebase’,’http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0’,’name’,’myFlash’,’width’,’550’,’height’,’400’,’align’,’middle’,’id’,’myFlash’,’src’,’geturl’,’quality’,’high’,’bgcolor’,’#ffffff’,’allowscriptaccess’,’sameDomain’,’allowfullscreen’,’false’,’pluginspage’,’http://www.macromedia.com/go/getflashplayer’,’movie’,’geturl?’+readURL() ); //end AC code
}
</script>
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" name="myFlash" width="550" height="400" align="middle" id="myFlash">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="geturl.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /> <embed src="geturl.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="myFlash" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</noscript>
</body>
</html>