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

无忧云(25元/月),国内BGP高防云服务器 2核2G5M

无忧云官网无忧云怎么样 无忧云服务器好不好 无忧云值不值得购买 无忧云,无忧云是一家成立于2017年的老牌商家旗下的服务器销售品牌,现由深圳市云上无忧网络科技有限公司运营,是正规持证IDC/ISP/IRCS商家,主要销售国内、中国香港、国外服务器产品,线路有腾讯云国外线路、自营香港CN2线路等,都是中国大陆直连线路,非常适合免北岸建站业务需求和各种负载较高的项目,同时国内服务器也有多个BGP以及高...

这几个Vultr VPS主机商家的优点造就商家的用户驱动力

目前云服务器市场竞争是相当的大的,比如我们在年中活动中看到各大服务商都找准这个噱头的活动发布各种活动,有的甚至就是平时的活动价格,只是换一个说法而已。可见这个行业确实竞争很大,当然我们也可以看到很多主机商几个月就消失,也有看到很多个人商家捣鼓几个品牌然后忽悠一圈跑路的。当然,个人建议在选择服务商的时候尽量选择老牌商家,这样性能更为稳定一些。近期可能会准备重新整理Vultr商家的一些信息和教程。以前...

digital-vm$80/月,最高10GDigital-VM1Gbps带宽带宽

digital-vm在日本东京机房当前提供1Gbps带宽、2Gbps带宽、10Gbps带宽接入的独立服务器,每个月自带10T免费流量,一个独立IPv4。支持额外购买流量:20T-$30/月、50T-$150/月、100T-$270美元/月;也支持额外购买IPv4,/29-$5/月、/28-$13/月。独立从下单开始一般24小时内可以上架。官方网站:https://digital-vm.com/de...

flash导航为你推荐
网页解密如何查看网页中的密码天天酷跑刷积分教程天天酷跑积分怎么获得 天天酷跑刷积分方法金山杀毒怎么样金山杀毒怎么样?怎么在qq空间里添加背景音乐如何在qq空间中添加背景音乐伪静态什么是伪静态伪静态有何作用不兼容安卓手机软件不兼容怎么办?qq空间装扮qq空间的装扮空间在哪?云挂机快手极速版后台云挂机辅?助各位用了吗?在哪找的?系统分析员如何成为系统分析师?虚拟机软件下载谁有虚拟机软件的网址要好用的
大连虚拟主机 深圳域名空间 主机点评 cve-2014-6271 便宜建站 国外bt 英语简历模板word 好看的桌面背景大图 一点优惠网 hostloc 谷歌台湾 免费网络 ledlamp 成都主机托管 江苏徐州移动 葫芦机 免费获得q币 九零网络 美国十大啦 nic 更多