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

Krypt($120/年),2vCPU/2GB/60GB SSD/3TB

Krypt这两天发布了ION平台9月份优惠信息,提供一款特选套餐年付120美元(原价$162/年),开设在洛杉矶或者圣何塞机房,支持Windows或者Linux操作系统。ion.kryptcloud.com是Krypt机房上线的云主机平台,主要提供基于KVM架构云主机产品,相对于KT主站云服务器要便宜很多,产品可选洛杉矶、圣何塞或者新加坡等地机房。洛杉矶机房CPU:2 cores内存:2GB硬盘:...

bgpto:日本独立服务器6.5折($120起),新加坡独立服务器7.5折($93起)

bgp.to在对日本东京的独立服务器进行6.5折终身优惠促销,低至$120/月;对新加坡独立服务器进行7.5折终身优惠促销,低至$93/月。所有服务器都是直连国内,速度上面相比欧洲、美国有明显的优势,特别适合建站、远程办公等多种用途。官方网站:https://www.bgp.to/dedicated.html主打日本(东京、大阪)、新加坡、香港(CN)、洛杉矶(US)的服务器业务!日本服务器CPU...

virmach:AMD平台小鸡,赌一把,单车变摩托?$7.2/年-512M内存/1核/10gSSD/1T流量,多机房可选

virmach送来了夏季促销,价格低到爆炸,而且在低价的基础上还搞首年8折,也就是说VPS低至7.2美元/年。不过,这里有一点要说明:你所购买的当前的VPS将会在09/30/2021 ~ 04/30/2022进行服务器转移,而且IP还会改变,当前的Intel平台会换成AMD平台,机房也会变动(目前来看以后会从colocrossing切换到INAP和Psychz),采取的是就近原则,原来的水牛城可能...

flash导航为你推荐
网站联盟百度网盟是什么,怎么加入商标注册查询官网如何在网上查询商标是否注册?iphone6上市时间苹果6什么时候出?多少钱小米手柄手机用小米手柄能玩什么游戏网络虚拟机如何设置vmware虚拟机网络网络虚拟机虚拟机网络怎么连接网站地图制作我想给网站做网站地图不知道怎么做的,请教高手!首页无法修改主页无法更改怎么办qq新闻弹窗QQ弹出新闻youtubemp3mp4仿真IPOD mp4 和真的IPOD mp4功能上有什么区别?
免费vps 187邮箱 息壤主机 winhost tier 60g硬盘 seovip 好看的桌面背景大图 godaddy域名证书 卡巴斯基免费试用 hdd ebay注册 数据库空间 lamp架构 lamp的音标 创速 网络速度 hostease 闪讯网 湖南铁通 更多