图片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

HostKvm:香港国际/韩国KVM夏季7折,2G内存套餐月付5.95美元起

HostKvm是一家成立于2013年的国外主机服务商,主要提供基于KVM架构的VPS主机,可选数据中心包括日本、新加坡、韩国、美国、中国香港等多个地区机房,均为国内直连或优化线路,延迟较低,适合建站或者远程办公等。目前商家发布了夏季特别促销活动,针对香港国际/韩国机房VPS主机提供7折优惠码,其他机房全场8折,优惠后2GB内存套餐月付5.95美元起。下面分别列出几款主机套餐配置信息。套餐:韩国KR...

HostYun 新上美国CN2 GIA VPS 月15元

HostYun 商家以前是玩具主机商,这两年好像发展还挺迅速的,有点在要做点事情的味道。在前面也有多次介绍到HostYun商家新增的多款机房方案,价格相对还是比较便宜的。到目前为止,我们可以看到商家提供的VPS主机包括KVM和XEN架构,数据中心可选日本、韩国、香港和美国的多个地区机房,电信双程CN2 GIA线路,香港和日本机房,均为国内直连线路。近期,HostYun上线低价版美国CN2 GIA ...

老周互联24小时无理由退款,香港原生IP,28元起

老周互联怎么样?老周互联隶属于老周网络科技部旗下,创立于2019年12月份,是一家具有代表性的国人商家。目前主营的产品有云服务器,裸金属服务器。创办一年多以来,我们一直坚持以口碑至上,服务宗旨为理念,为用户提供7*24小时的轮班服务,目前已有上千多家中小型站长选择我们!服务宗旨:老周互联提供7*24小时轮流值班客服,用户24小时内咨询问题可提交工单,我们会在30分钟内为您快速解答!另免费部署服务器...

flash导航为你推荐
视频截图软件我想知道什么软件可以从视频中截图?安装程序配置服务器失败win10安装程序配置服务器失败怎么办yy频道中心YY怎么进入频道中心天天酷跑刷积分教程最近一直有人说天天酷跑刷积分,怎么刷的。照片转手绘有没有一种软件是可以把一张照片变成手绘的图片,给推荐下彩信中心移动的彩信中心是?主页是?收不到彩信,怎么设置?qq空间打扮QQ空间打扮二层交换机集线器和二层交换机,三层交换机的区别机械键盘轴机械键盘什么轴好,机械键盘轴有几种什么是云平台谁能简单说一下什么是云平台啊?
vps租用 双线vps 域名解析服务器 132邮箱 google电话 国外idc 免备案cdn 12u机柜尺寸 远程登陆工具 最好的免费空间 699美元 美国堪萨斯 天翼云盘 爱奇艺会员免费试用 支持外链的相册 无限流量 360云服务 dnspod 下载速度测试 全能空间 更多