图片flash动态缓冲图片导航制作详解

flash导航  时间:2021-02-16  阅读:()

flash动态缓冲图片导航制作详解

The buffer formula is very useful in making special effects.The famous Samsung navigation menu uses this formula. Manywebsites are now in the limelight, and buffer navigation is oneof the highlights. This article takes the navigation of aGermanwebsite as an example to explain the manufacture of buffernavigation. This effect is done by me and the solvent. Heprovides the coordinate algorithm, and I provide the scalingalgorithm.

This example demonstrates the effect

The part of the mouse across the picture will become largerProduction ideas

Picture zoom control

Using the buffer formula to set the zoom ratio of the picture,if the mouse glides through a picture, zoom in 1.8 times. Ifthe serial number of the other picture is 1 different from thatof the picture, the picture on both sides of the picture ismagnified 1.4 times, and the other is of the original size.Picture coordinate control

When a picture is enlarged, the coordinates of the adjacentpictures are equal to the coordinates of the image, plus halfof the width of the two pictures, so that the pictures arearranged without distance.

Line and text control

Lines are implemented using line drawing functions, and thecoordinates and scale of text are the same as those of thecorresponding pictures.

Making process

1, startFlash, create anewmovie, set the size of 600px*200px.Get ready, like the material in the picture. The actual namesof the pictures are zjs0 to zjs4, and the literal names of thetext are Z0 to z4.

The intermediate image coordinates set (300130) , select all thepictures, arranged according to CTRLK panel set to top out, makethe same picture, y coordinates, X coordinate picturecontrolled by AS. In the same way that y coordinates the samecharacters, and adjust the spacing of text and pictures.2, add the following code on the first frame in the main sceneX / / get intermediate image coordinates

For (VaR = I = 0; i<5; i++) {

This["ZJS", +i] .n = i;

Each picture / / MC define a variable

This["ZJS", +i] .onRollOver = function () {

Control = true;

Mouse over the picture is true / /

} ;

This["ZJS", +i] .onRollOut = function () {

Control = false;

The picture is false when the mouse out of /

} ;

}

OnEnterFrame = function () {

For (VaR = k = 0; k<5; k++) {

This["Z", +k] ._x = this[, "ZJS", +k] ._x;

X/text should be equal to the X coordinate coordinate pictureThis["Z", +k] ._xscale = this[, "ZJS", +k] ._xscale;

This["Z", +k] ._yscale = this[, "ZJS", +k] ._yscale;

/ / text and pictures the same zoom ratio

}

If (control) {

Mouse_in () ;

} else {

Mouse_out () ;

}

/ / call the function condition of true or false when} ;

/ / coordinate setting function

Function, setX () {

For (VaR k = -2; k<3; k++) {

This["ZJS" + (k+2) ] ._x = myx+this["ZJS" +2] ._width*k;In the middle picture is / / no distance arrangement

}

For (VaR k = Number (temp 1) +1; k<5; k++) {

//temp1 is the variable value under the maximum scaled picture

this was mc1 = ["zjs' + k] ;this was mc2 = ["zjs' + (k - 1) ] ;

/ /此图片右边的其它图片mc1. _x = mc2. _x + (mc2. _width + mc1. _ width) / 2 - 1;/ /设置这些图片的x坐标, 1为消除图片间的空隙

}for (where k = number (temp1) - 1; k > 1; k) {this was mc1 = ["zjs' + k] ;this was mc2 = ["zjs' + (k + 1) ] ;mc1. _x = mc2. _x - (mc2. _width + mc1. _ width) / 2 + 1;}

/ /缩放比例最大的图片的左边的图片的x坐标设置myline () ;

/ /图片下方的线条

}

/ /比例缩放函数function move _ scale (x, obj) {speed = (x - obj. _ xscale) *.65 + speed * 0.6;obj. _ xscale + = speed;obj. _ yscale + = speed;

/ /缓冲公式, x为图片的缩放比例, obj为mc}

/ /鼠标滑过图片时, 图片的缩放、 x坐标设置函数function mouse _ () {for (i = 0; i < 5; i + +) {where mc = this ["zjs" +] ;

/ /获得实例名i f (mc.hittest (_xmouse, _ ymouse, true)) {move _ scale (180, mc) ;

/ /如果鼠标位于图片的上方, 图片放大1.8倍t emp 1 = mc.n;

/ /把此图片下的变量赋给变量t emp 1

} else if (math.abs (mc.n-temp1) = = 1) {move _ scale (140, mc) ;

/ /两侧的图片比例放大1.4倍

} else {move _ scale (100, mc) ;

/ /其它的图片为原始大小

}

}setx () ;

/ /设置图片的x坐标

}

/ /鼠标移出图片时, 图片的缩放、 x坐标设置函数function mouse _ out () {for (i = 0; i < 5; i + +) {

move _ scale (100, this "zjs" [+]) ;

/ /缩放比例为1,恢复原始大小

}setx () ;

/ /坐标复原

}

/ /线条函数function myline () {createemptymovieclip ("line", 1) ;

/ /创建一个空影片with (line) {linestyle (0. 1, 0xff9933, 100) ;moveto (zjs0. _ x - zjs0. _ width / 2, zjs0. _y + 10) ;lineto (zjs4. _ x + zjs4. _ width / 2, zjs4. _ y + 10) ;/ /图片下方水平的直线moveto (zjs0. _ x - zjs0. _ width / 2, zjs0. _y + 5) ;

lineto (zjs0. _ x - zjs0. _ width / 2, zjs0. _y + 15) ;/ /右边垂直的直线moveto (zjs4. _ x + zjs4. _ width / 2, zjs4. _ y + 5) ;lineto (zjs4. _ x + zjs4. _ width / 2, zjs4. _ y + 15) ;/ /左边垂直的直线

}

}

按ctrl + enter测试,本例制作完成.掌握原理后,加上好的创意,相信你能做出更好的特效.

资料引用: http: / / www.knowsky.

With / 340840.html

新加坡云服务器 1核2Gg 46元/月 香港云服务器 1核2G 74元/月 LightNode

LightNode是一家成立于2002年,总部位于香港的VPS服务商。提供基于KVM虚拟化技术.支持CentOS、Ubuntu或者Windows等操作系统。公司名:厦门靠谱云股份有限公司官方网站:https://www.lightnode.com拥有高质量香港CN2 GIA与东南亚节点(河内、曼谷、迪拜等)。最低月付7.71美金,按时付费,可随时取消。灵活满足开发建站、游戏应用、外贸电商等需求。首...

[6.18]DogYun:充100送10元,态云7折,经典云8折,独立服务器月省100元,幸运大转盘最高5折

DogYun是一家2019年成立的国人主机商,提供VPS和独立服务器租用等,数据中心包括中国香港、美国洛杉矶、日本、韩国、德国、荷兰等,其中VPS包括常规VPS(经典云)和按小时计费VPS(动态云),使用自行开发的面板和管理系统,支持自定义配置,动态云各个硬件独立按小时计费,带宽按照用户使用量计费(不使用不计费)或者购买流量包,线路也可以自行切换。目前商家发布了6.18促销方案,新购动态云7折,经...

2021年恒创科技618活动:香港/美国服务器/云服务器/高防全场3折抢购

2021年恒创科技618活动香港美国服务器/云服务器/高防全场3折抢购,老客户续费送时长,每日限量秒杀。云服务器每款限量抢购,香港美国独服/高防每款限量5台/天,香港节点是CN2线路还不错。福利一:爆品秒杀 超低价秒杀,秒完即止;福利二:云服务器 火爆机型 3折疯抢;福利三:物理服务器 爆款直降 800元/月起;福利四:DDOS防护 超强防御仅 1750元/月。点击进入:2021年恒创科技618活...

flash导航为你推荐
解压程序手机解压软件zarchiver怎么用明星论坛怎么建免费的论坛网站?如何免费开通黄钻如何免费开通黄钻??最新qq空间代码QQ空间代码有哪些???硬盘人克隆一个人需要多少人多长时间啊怎么点亮qq空间图标QQ空间图标怎么点亮?虚拟专用网虚拟专用网 有什么用处?云挂机有免费的云挂机软件吗?怎么上传音乐怎么上传音乐php购物车PHP中用json实现购物车功能,怎么实现
二级域名 欧洲免费vps 域名备案批量查询 花生壳免费域名 locvps 360抢票助手 建站代码 卡巴斯基永久免费版 个人免费空间 150邮箱 灵动鬼影 gg广告 全站静态化 大容量存储器 php空间推荐 徐正曦 卡巴斯基免费试用 美国独立日 1元域名 架设邮件服务器 更多