【中华硕博网-全球500所高校指定报名中心】
【在职研究生】 【在职博士】 【MBA/EMBA】
  您现在的位置: 中华硕博网 > IT培训 > IT技术 > 多媒体 > 文章正文
站内搜索:

通过flash as识别域名并分别跳转

作者:佚名    文章来源:不详    点击数:    更新时间:2008-5-10
中华硕博网(http://www.china-b.com)全球500所高校指定报名中心--通过flash as识别域名并分别跳转

手上有两个cn域名,买了一个虚拟主机,想把两个域名都捆在上面。

代码如下:

url1 = "http://www.tutututu.cn";
url2 = "http://tutututu.cn";
if ((_url.substring (0, 20) == url1.substring (0, 20)) || (_url.substring (0, 16) == url2.substring (0, 16)))
{
   getURL("http://www.tutututu.cn/index.html","_self");
}
url3 = "http://www.huisemuma.cn";
url4 = "http://huisemuma.cn";
if ((_url.substring (0, 20) == url3.substring (0, 20)) || (_url.substring (0, 16) == url4.substring (0, 16)))
{
getURL("http://www.huisemuma.cn/index.htm","_self");
}

————————————————————————————————————————
代码参考了(http://www.blueidea.com/tech/multimedia/2007/4438_3.asp)
如果要允许多个域名,可以这样写:
url = "http://www.zhugao.cn";
url2 = "http://zhugao.cn";
if((_url.substring(0, 20)==url) || (_url.substring(0, 16)==url2)){
gotoAndPlay(3);
}else{
gotoAndStop(2);
}
————————————————————————————————————————
发现按照“_url.substring(0, 20)==url”的比较方法是不行的,url同样需要“.substring(0, 20)”

将flash生成url.swf放到网站swf目录,将url.swf嵌入default.html,并且将服务器默认文档“default.html”优先级设置最高。

这样的话,通过两个不同域名可以访问到不同的页面,达到并存的目的。

swf路径为:/Files/BeyondPic/2008-1/12/url.swf 或者 /Files/BeyondPic/2008-1/12/url.swf

               或者/Files/BeyondPic/2008-1/12/url.swf   或者 /Files/BeyondPic/2008-1/12/url.swf

页面的相对路径为:默认页面:default.html    灰色木马的:/index.htm   屠屠兔兔的:/index.html

输入不同域名可测试效果。开始的“无标题文档”的Title是default.html   页面的

url.rar (4.12 KB)

 相关热词搜索
>>更多
  • 此栏目下没有文章