图片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($4.25/月)俄罗斯/香港高防VPS

HostKvm又上新了,这次上架了2个线路产品:俄罗斯和香港高防VPS,其中俄罗斯经测试电信CN2线路,而香港高防VPS提供30Gbps攻击防御。HostKvm是一家成立于2013年的国外主机服务商,主要提供基于KVM架构的VPS主机,可选数据中心包括日本、新加坡、韩国、美国、中国香港等多个地区机房,均为国内直连或优化线路,延迟较低,适合建站或者远程办公等。俄罗斯VPSCPU:1core内存:2G...

建站选择网站域名和IP主机地址之间关系和注意要点

今天中午的时候有网友联系到在选择网站域名建站和主机的时候问到域名和IP地址有没有关联,或者需要注意的问题。毕竟我们在需要建站的时候,我们需要选择网站域名和主机,而主机有虚拟主机,包括共享和独立IP,同时还有云服务器、独立服务器、站群服务器等形式。通过这篇文章,简单的梳理关于网站域名和IP之间的关系。第一、什么是域名所谓网站域名,就是我们看到的类似"www.laozuo.org",我们可以通过直接记...

易探云月付18元起,香港/美国/深圳/北京VPS,CN2、BGP等多线路

易探云怎么样?易探云是国内一家云计算服务商家,致力香港服务器、国内外服务器租用及托管等互联网业务,目前主要地区为运作香港BGP、香港CN2、广东、北京、深圳等地区。易探云服务器均选择当下热门线路,比如CN2 GIA、BGP线路、CN2线路等,所有云主机支持月付,并且首月优惠,年付优惠,优惠后香港沙田云服务器/独立ip/香港CN2线路,每月仅18元,188元/年。点击进入:易探云官方网站地址1、香港...

flash导航为你推荐
authorware素材怎么将authorware制作出来的图片加入桌面背景博客外链博客和博客之间怎么建超级链接百度抢票浏览器百度浏览器怎么抢票?网站联盟网络联盟是什么意思畅想中国用“心系祖国情,畅想中国梦”为题目的800字作文idc前线永恒之塔内侧 删档吗 ?mate8价格华为麦特八多少价格网络虚拟机虚拟机的网络怎么弄?域名库电脑上文件有多少域名?各什么意思?网站排名靠前全国B2B网站排名靠前的有哪些
深圳虚拟主机 广西虚拟主机 荷兰vps 工信部域名备案系统 如何申请免费域名 企业主机 highfrequency 美元争夺战 kddi 美国便宜货网站 双12活动 php免费空间 嘉洲服务器 申请个人网站 lol台服官网 网页提速 789 监控服务器 国外在线代理服务器 群英网络 更多