首页 | 网页设计 | w3c标准 | flash动画 | 平面设计 | 经典文章 | 特约专题 | 资源下载 | 健康频道 | 重庆品牌网站 | 留言簿 | 
技术文章  资源下载 经典素材  社区论坛
   
 您现在的位置: vi设计在线 >> 经典文章 >> 平面设计 >> 设计理念 >> 正文  
  Flash与JavaScript信息交互         
[ 作者:佚名    转贴自:本站原创    点击数:2335    更新时间:2007/2/5    文章录入:QQ392398985

减小字体 增大字体

网上提供的这方面资料太少了,研究一两天,做了个例子,大家可以参考!


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Flash与3D信息交互</title>
<style type="text/CSS">
<!--
td {}{
    font-family: "宋体";
    font-size: 12px;
}
-->
</style>
</head>
<body onLoad="Init();">
  <p>
        <!--定义TerraExplorer的信息窗口对象-->
        <object ID="TEInformationWindow" classid="CLSID:3a4f9193-65a8-11d5-85c1-0001023952c1" width="300" height="400"></object>
        <!--定义一个TerraExplorer 3D窗口对象-->
        <object ID="TE3DWindow" classid="CLSID:3a4f9192-65a8-11d5-85c1-0001023952c1" width=650 height="400"></object>
        <!--定义TerraExplorer对象-->
        <object ID="TE" CLASSId="CLSID:3a4f9191-65a8-11d5-85c1-0001023952c1"></object>
 </p>

<table width="937" border="1" align="left">
  <tr>
    <td width="369" align="center">
        <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="300" height="150" id="Flash1" align="middle">
            <param name="allowScriptAccess" value="sameDomain" />
            <param name="movie" value="f2.swf" />
            <param name="quality" value="high" />
            <param name="bgcolor" value="#ffffff" />
            <embed src="f2.swf" quality="high" bgcolor="#ffffff" width="300" height="150" name="Flash1"  swLiveConnect="true" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
        </object>
    </td>
<!--    -->
    <td width="282" align="center">
        <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="300" height="150" id="myFlash" align="middle">
            <param name="allowScriptAccess" value="sameDomain" />
            <param name="movie" value="f4.swf" /><param name="quality" value="high" />
            <param name="bgcolor" value="#ccffff" />
            <embed src="f4.swf" quality="high" bgcolor="#ccffff" width="300" height="150" name="myFlash" swLiveConnect="true" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
        </object>
    </td>
    <td width="264" colspan="2" align="left">
        <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="btn1" width="100" height="50" align="middle">
            <param name="allowScriptAccess" value="sameDomain" />
            <param name="movie" value="btn1.swf" />
            <param name="quality" value="high" />
            <param name="bgcolor" value="#ffffff" />
            <embed src="btn1.swf" quality="high" bgcolor="#ffffff" width="100" height="50" swLiveConnect=true id="btn1" name="btn1" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
        </object>
 </td>
  </tr>
  <tr>
  <td width="369" height="200" align="center">
  </td></tr>
</table>
</html>
<script language="javascript">
   
    var ITerraExplorer = null;
    var IPlane  = null;
    var IMenu  = null;
    var IObjectManager = null;
    var IRender=null;
    var ZoomMode = 0;
    var zoom_array = new Array();
    //浏览器设置
    var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
   
//初始化
function Init()
{
    var temp;
    ITerraExplorer = TE.interface("ITerraExplorer5");
    IPlane = TE.interface("IPlane5");
    IInformationTree = TE.interface("IInformationTree5");
    IMenu = TE.interface("IMenu");
    IObjectManager = TE.interface("IObjectManager5");
    ITerraExplorer.Load("2.fly");
    IRender=TE.interface("IRender5");
}
//飞到某个地方--------------------------------------------------------------------------------------------------// 处理 Flash 影片中的所有 FSCommand 消息
function myFlash_DoFSCommand(args1,args2)   
{
    var myFlashObj = InternetExplorer ? myFlash : document.myFlash;
    var tX0,tZ0;
    tX0 =args1;
    tZ0 =args2;
   FlyToWhere(tX0,tZ0);
}
// 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');
}

function FlyToWhere(tX0,tZ0)
{
    //创建文本对象
    var LabelInfo = new Object();
    LabelInfo.Text = "经度   :   "+tX0+"    纬度   :   "+tZ0;
    LabelInfo.Scale = 1;
    LabelInfo.BgColor = 236;

    IObjectManager.CreateLabel (LabelInfo, tX0, tZ0, 2000.0 );
    IPlane.FlyTo (tX0,tZ0,2000.0,117.98,0, -35,"Oval" );
}
//飞到某地------------------------------------------------------------------------------------------------------
function btn1_DoFSCommand(command, args) {
    var btn1Obj = InternetExplorer ? document.all.btn1 : document.btn1;
    var tX0;
    tX0 =args;
    klmy();
}
// 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 btn1_FSCommand(ByVal command, ByVal args)\n');
    document.write('    Call btn1_DoFSCommand(command, args)\n');
    document.write('End Sub\n');
    document.write('</script\>\n');
}

function klmy()
{
    //创建文本对象
    var LabelInfo = new Object();
    LabelInfo.Text = "中国 "
    LabelInfo.Scale = 1;
    LabelInfo.BgColor = 236;

    IObjectManager.CreateLabel (LabelInfo, 87, 45, 2000.0 );
    IPlane.FlyTo (87,45,2000.0,117.98,0, -35,"Oval" );
}
//-------------------------------------------------------------------------------------------------------------------

</script>

<script language="vbscript">
function TE_OnFrame()
    dim x1,y1
    IRender.GetMouseInfo 1,x1,y1  ObjType = 0
    IRender.ScreenToWorld x1,y1,ObjType,WorldX,WorldHeigth,WorldY,ObjectID
       window.document.Flash1.SetVariable "x", WorldX
    window.document.Flash1.SetVariable "y", WorldY
    end function
   
</script>

 上一篇文章: 如何提高网站的Google PR值
 下一篇文章: CSS样式表:详细介绍IE7新支持的选择器
发表评论】【告诉好友】【打印此文】【关闭窗口


技术文章  资源下载
经典素材  社区论坛
 中大型美容美发店老…[1061]
 重庆多达学习俄语培…[2288]
 重庆恒祥广告有限公…[1990]
 重庆市南方阻燃电线…[2402]
 重庆舞美灯光音响有…[3145]
 重庆德鼎滤油机有限…[1908]
 重庆民生建材有限公…[2349]
 重庆集元科技有限公…[4128]
 重庆倍润商贸有限公…[2015]
 重庆腾达展览有限公…[3081]
 帝一网络创始人宣…--[3177]
 重庆vi设计在线祝…--[2740]
 重庆帝一网络书生…--[2855]
 馋嘴鸭的起伏和经…--[3000]
 机器感觉“卡”的…--[2929]
 ActionScript3打造…--[5757]
 在ASP文件中读取H…--[7239]
 vi设计经典案例--[63826]
 帅到掉渣-爆笑版勇…--[7066]
 一个女孩写的经典…--[6827]
没有相关文章
 (只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    没有任何评论
设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | 重庆网站建设 | 
版权所有: vi设计在线  © 2005-2018 网站备案序号:渝ICP备06003824号
技术支持:帝一网络(重庆网站建设专家)