论坛交流
首页办公自动化| 网页制作| 平面设计| 动画制作| 数据库开发| 程序设计| 全部视频教程
应用视频: Windows | Word2007 | Excel2007 | PowerPoint2007 | Dreamweaver 8 | Fireworks 8 | Flash 8 | Photoshop cs | CorelDraw 12
编程视频: C语言视频教程 | HTML | Div+Css布局 | Javascript | Access数据库 | Asp | Sql Server数据库Asp.net  | Flash AS
当前位置 > 文字教程 > Flash教程
Tag:flash cs,flash 8,鼠绘,as,手绘,工具,文字,loading,入门,初学,mc,影片剪辑,声音,mtv,游戏,引导,遮罩,菜单,补间,广告条,时钟,视频教程

关于Flash+HTML实用技巧的一点补充

文章类别:Flash | 发表日期:2008-9-21 15:08:26

  很早前在做本站V2时用到的一些代码,也比较实用,现在贡献出来,希望对大家有用
Flash与html 的一些实用技巧

状态栏的文字显示,可以用来在做E文字按钮的时候方便不懂E文的人理解
<script language="JavaScript">
function interpret(text) {
window.status = text
}
</script>

设为首页(一般关闭窗口,加入收藏都比较简单,这个稍微需要点技巧)
<script language="JavaScript">
function sethomepage(){
document.all.sethomepage.click()
}
</script>
<a id="sethomepage" href="#" onClick="this.style.behavior=’url(#default#homepage)’;this.setHomePage(’http://www.blackflasher.net’);"></a>

Flash中直接调用sethomepage()函数即可

一段ASP代码,取得访问者的IP地址,操作系统,浏览器(版本类型不是很全,大家可以再尝试补充一下)
<%
function GetBorwser()
dim BcType,Browser,System,Ver,strSystem,strBrowser
str = Request.ServerVariables("HTTP_USER_AGENT")
Agent = split(str,";")
Browser = "Unknown"
System = "Unknown"
BcType = 0
if InStr(Agent(1),"U")>0 and not(InStr(str, "Gecko")>0 and InStr(str, "Netscape")>0) then
Ver = mid(Agent(0),InStr(Agent(0), "/")+1)
Ver = mid(Ver,1,InStr(Ver,"[")-1)
Browser = "Netscape " + Ver
System = mid(Agent(0),InStr(Agent(0), "(")+1)
if not(InStr(System,"Windows")>0) then
System = replace(System, "Win", "Windows ")
end if
end if
if InStr(str, "Gecko")>0 and InStr(str, "Netscape")>0then
if InStr(str,"Netscape6")>0 then
Ver = mid(Agent(4),InStr(Agent(4),"Netscape6")+10)
else
Ver = mid(Agent(4),InStr(Agent(4),"Netscape")+9)
end if
Browser = "Netscape " & Ver
System = replace(Agent(2),")", "")
if not(InStr(System,"Windows")>0) then
System = replace(System, "Win", "Windows ")
end if
end if
if InStr(Agent(1),"IE") >0 then
Browser = Agent(1)
System = replace(Agent(2),")", "")
if not(InStr(System,"Windows")>0) then
System = replace(System, "Win", "Windows ")
end if
end if
if InStr(Agent(1),"IE") >0 and InStr(str,"Opera") >0 then
Browser = mid(Agent(2), InStr(Agent(2),")")+2, InStr(Agent(2),"Opera")-4)
System = mid(Agent(2),1,InStr(Agent(2),")"))
System = replace(System, ")", "")
if not(InStr(System,"Windows")>0) then
System = replace(System, "Win", "Windows ")
end if
end if
strSystem = System
if InStr(strSystem, "98") >0 and InStr(str,"Win 9x") >0 then
strSystem = replace(strSystem, "98", "Me")
end if
strSystem = replace(strSystem, "9x 4.90", "Me")
strSystem = replace(strSystem, "NT 5.0", "2000")
strSystem = replace(strSystem, "NT 5.1", "XP")
strSystem = replace(strSystem, "NT 5.0", "2000")
strSystem = replace(strSystem, "NT 5.2","2003")
strBrowser = replace(Browser, "MSIE", "Internet Explorer")
GetBorwser = strSystem&"+"&strBrowser&"+"&Request.ServerVariables("REMOTE_ADDR")
end function
dim bor,borwsys
bor = GetBorwser()
borwsys = split(bor,"+")
%>
//系统版本,浏览器,IP地址
这是SWF文件在读取的时候变量引用
system=<%=borwsys(0)%>&explorer=<%=borwsys(1)%>&ip=<%=borwsys(2)%>
上一篇:{技巧}构图与背景 人气:1433
下一篇:{技巧}创建个性化TextField 人气:2467
视频教程列表
文章教程搜索
 
Flash推荐教程
Flash热门教程
看全部视频教程
购买方式/价格
购买视频教程: 咨询客服
tel:15972130058