注册 | 登录 忘记密码? 51cto首页 | 博客 | 论坛 | 招聘
热点文章 WEB3.0来了,能知道100米..
 帮助

flash跳转网页锚点的方法


2008-01-30 17:19:43
 标签:flash action sctipt   [推送到技术圈]

尝试了一下:

on (release) {
       a = "a.html#flag";
       getURL(a, "_self");
}


结果传到网页,网址变成a.html,没有后面那段了
以为是ie的问题,后来怀疑是否url的问题,也许应该换个写法:

on (release) {
       a = escape("a.html#flag");
       getURL(a, "_self");
}


这个方法就可以,把url先处理一下就可以了


方法2flash按钮代码:

CODE:
on (release) {
    fscommand("anchor","#flag");
}

按钮ID,name为button。

添加到页面中<head></head>的JS代码:

<script language=javascript>
          function button_DoFSCommand(command,args)
          {if(command == "anchor"){
          window.location.href=args;}
          }
</script>
<SCRIPT LANGUAGE=VBScript>
          Sub button_FSCommand(ByVal command, ByVal args)
          call button_DoFSCommand(command, args)
          end sub
</SCRIPT>

------------------------------------------------------------------

escape 函数

escape(expression:String) : String
将参数转换为字符串,并以 URL 编码格式对其进行编码,在这种格式中,所有非字母数字的字符都替换为 % 十六进制序列。当用于 URL 编码的字符串中时,百分号 (%) 用于引入转义符,不与模运算符 (%) 等效。




    文章评论
 
2008-01-30 17:26:39
学习了 不错的东东

 

发表评论

昵   称:
验证码:  点击图片可刷新验证码  博客过2级,无需填写验证码
内   容: