文件名称:
豪华首页调用Flash自动变换效果(附源代码)
开发工具:
文件大小: 611kb
下载次数: 0
上传时间: 2007-03-22
详细说明: [color=Red]普通用户下载前请先注册并登陆才可正常下载[/color] [font=黑体][size=4]内附完整源代码,欢迎批评指正[/size][/font][emc20] [b]官方网站[/b] [url=http://www.nvan.net/]http://www.nvan.net/[/url] [img]http://www.nvan.net/images/logo_header.gif[/img] [color=Navy]文档说明《关于首页调用经典随即Flash.(模拟Adobe官方网站)》 1.大尺寸flash调用方法 请将FMA文件夹上传至网站更目录 在您的网站首页调用/FMA/FMA.swf XML存放目录/FMA/swf/homepage/fma/en_us/FMA.xml 被调用Flash存放目录/FMA/swf/homepage/fma/en_us/assets/(*.swf) FMA.xml中可修改所调用的swf文件属性[/color] [color=Red]效果演示地址:[/color] [url=http://www.nvan.net/]http:// www.nvan.net/[/url] [b]参考代码:[/b] [code]function closeFMA() { FMA.closeAllIntervals(); FMA_target.onFinalize(); } // End of the function function loadXML(which_file) { trace (\"which_file: \" + which_file); navDoc = new XML(); navDoc.ignoreWhite = true; navDoc.onLoad = buildArrays; navDoc.load(which_file); } // End of the function function buildArrays() { var _loc1 = _global; arrayLink = new Array(); arrayPercent = new Array(); myTrace(\"Loaded xml, and processing it into an array...\"); for (x = 0; x < navDoc.firstChild.childNodes.length; x++) { arrayLink.push(_loc1.pathPrefix + navDoc.firstChild.childNodes[x].attributes.LOCATION); arrayPercent.push(navDoc.firstChild.childNodes[x].attributes.PERCENT); } // end of for pickFMA(); } // End of the function function pickFMA() { var _loc1 = this; choice = Math.round(Math.random() * 100); myTrace(\"Random number is \" + choice); number_00 = 100; for (i = 0; i < arrayLink.length; i++) { _loc1[\"number_0\" + (i + 1)] = _loc1[\"number_0\" + i] - arrayPercent[i]; if (choice > _loc1[\"number_0\" + (i + 1)] && choice <= _loc1[\"number_0\" + i]) { FMA_target.loadMovie(arrayLink[i]); loadFMAInterval = setInterval(loadFMA, 25); myTrace(\"Load this FMA - \" + arrayLink[i]); if (Number(importFonts) == 1) { gotoAndStop(\"import\"); } // end if return; } // end if } // end of for } // End of the function function loadFMA() { if (FMA_target.getBytesTotal() != 0) { FMA_percent = Math.round(FMA_target.getBytesLoaded() / FMA_target.getBytesTotal() * 100); FMA_loader.percent = FMA_percent + \"% loaded.\"; myTrace(\"loading...FMA\"); if (FMA_percent == 100) { FMA.alphaTo(black, 0, 1.500000E-001, 25); FMA_loader._visible = false; clearInterval(loadFMAInterval); myTrace(\"done loading...FMA\"); } else { FMA_loader._visible = true; } // end if } // end else if } // End of the function function myTrace(str) { trace (str); debug.text = debug.text + (\"\\n\" + str); } // End of the function stop (); _global.locale = locale != undefined ? (locale) : (\"en_us\"); _global.fmaLoc = fmaLoc != undefined ? (fmaLoc) : (\"/FMA/swf/homepage/fma/\"); myTrace(\"scooping pathPrefix :: \" + pathPrefix); _global.pathPrefix = pathPrefix; XML_path = _global.pathPrefix + _global.fmaLoc + _global.locale + \"/FMA.xml\" + \"?\" + Math.random(); _global.FMA = new Object(); FMA.tweenTo = function (clip, x_target, y_target, speed, bounce, interval) { var _loc1 = clip; FMA.removeInterval(_loc1.tweenInterval); _loc1.tweenInterval = FMA.addInterval(FMA.tweenCalculate, interval, _loc1, x_target, y_target, speed, bounce); trace (\"tweenObject > interval started :: \" + _loc1._name); }; FMA.tweenCalculate = function (scope, x_target, y_target, speed, bounce) { var _loc1 = scope; var _loc2 = y_target; var _loc3 = x_target; trace (\"~~~~~~~~~~~~~~~~~\"); trace (\"FMA.tweenCalculate :: \" + arguments.join()); if (_loc1._x <= _loc3) { _loc1.ax = (_loc3 - _loc1._x) * speed; _loc1.vx = _loc1.ax + (_loc1.vx == undefined ? (0) : (_loc1.vx)); _loc1.vx = _loc1.vx * bounce; _loc1._x = _loc1._x + _loc1.vx; trace (\"tweenObject > moving x :: \" + _loc1.vx); } // end if if (_loc1._y <= _loc2) { _loc1.ay = (_loc2 - _loc1._y) * speed; _loc1.vy = _loc1.ay + (_loc1.vy == undefined ? (0) : (_loc1.vy)); _loc1.vy = _loc1.vy * bounce; _loc1._y = _loc1._y + _loc1.vy; trace (\"tweenObject > moving y...\"); } // end if if (_loc1._x > _loc3 && _loc1._y > _loc2) { FMA.removeInterval(_loc1.tweenInterval); trace (\"tweenObject > interval cleared\"); } // end if updateAfterEvent(); }; FMA.alphaTo = function (clip, alpha_target, speed, interval) { var _loc1 = clip; FMA.removeInterval(_loc1.alphaInterval); _loc1.movieColor = new Color(_loc1); _loc1.movieTransform = _loc1.movieColor.getTransform(); _loc1.alphaInterval = FMA.addInterval(FMA.alphaCalculate, interval, _loc1, alpha_target, speed); trace (\"alphaObject > interval started\"); }; FMA.alphaCalculate = function (scope, alpha_target, speed) { var _loc1 = scope; var _loc2 = alpha_target; if (_loc1.movieTransform.aa != _loc2) { distance = _loc2 - _loc1.movieTransform.aa; increment = distance * speed; _loc1.movieTransform.aa = _loc1.movieTransform.aa + increment; if (Math.abs(distance) < 5.000000E-001) { _loc1.movieTransform.aa = _loc2; } // end if _loc1.movieColor.setTransform(_loc1.movieTransform); trace (\"alphaObject > updating alpha...\"); } else { FMA.removeInterval(_loc1.alphaInterval); trace (\"alphaObject > interval cleared\"); } // end else if if (_loc1.movieTransform.aa == 0) { _loc1._visible = false; } else { _loc1._visible = true; } // end else if updateAfterEvent(); }; FMA.closeAllIntervals = function () { for (var _loc1 in FMA.openIntervals) { FMA.removeInterval(_loc1); } // end of for...in }; FMA.addInterval = function () { var _loc1 = setInterval.apply(this, arguments); if (FMA.openIntervals == undefined) { FMA.openIntervals = new Object(); } // end if FMA.openIntervals[_loc1] = 1; return (_loc1); }; FMA.removeInterval = function (intervalID) { delete FMA.openIntervals[intervalID]; clearInterval(intervalID); }; Stage.showMenu = false; FMA_loader._visible = false; loadXML(XML_path); [/code] ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.