日韩天天综合网_野战两个奶头被亲到高潮_亚洲日韩欧美精品综合_av女人天堂污污污_视频一区**字幕无弹窗_国产亚洲欧美小视频_国内性爱精品在线免费视频_国产一级电影在线播放_日韩欧美内地福利_亚洲一二三不卡片区

簡(jiǎn)單實(shí)現(xiàn)AS繪制貝塞爾曲線_Flash教程

編輯Tag賺U幣
教程Tag:暫無(wú)Tag,歡迎添加,賺取U幣!

推薦:符合web標(biāo)準(zhǔn)的flash調(diào)用方法,解決了瀏覽器對(duì)flash的影響
最近在研究web標(biāo)準(zhǔn),目前取得一些進(jìn)展,在制作過(guò)程中通過(guò)國(guó)外一些優(yōu)秀網(wǎng)站找到了解決flash調(diào)用符合標(biāo)準(zhǔn)的方法。首先建立一個(gè)js文件flash.js,內(nèi)容為:functio

看看效果吧:
/UploadTeach/200708/20070829164722123.swf
AS如下:
//這個(gè)函數(shù)是用來(lái)繪制線條的
function connect(){
this.clear()
this.lineStyle(3,0x660000,100)
this.moveTo(anchorOne._x,anchorOne._y)
this.curveTo(controlOne._x,controlOne._y,anchorTwo._x,anchorTwo._y)
updateAfterEvent()
}
//這個(gè)函數(shù)是用來(lái)繪制替代描點(diǎn)跟控制點(diǎn)的MC,就繪制一個(gè)正方形吧
function createSquare(handle,side,offset){
if(offset==undefines){
offset=0
}
with(handle){
moveTo(offset,offset)
lineTo(offset,side)
lineTo(side,side)
lineTo(side,offset)
lineTo(offset,offset)
endFill()
}
}
//這是用來(lái)控制描點(diǎn)跟控制點(diǎn)的移動(dòng),并且用延時(shí),間隔一段時(shí)間調(diào)用一次繪制線條
function setDraggable(handle){
handle.onPress=function(){
clearInterval(_global.refreshScreen)
_global.refreshScreen=setInterval(this._parent,"connect",10)
this.startDrag(false)
}
handle.onRelease=function(){
clearInterval(_global.refreshScreen)
this.stopDrag()
}
handle.onReleaseOutside=function(){
clearInterval(_global.refreshScreen)
this.stopDrag()
}
}
//建立描點(diǎn)
anchorOne=createEmptyMovieClip("anchorPoint1",this.getNextHighestDepth())
anchorOne._x=anchorOne._y=50
//填充
anchorOne.beginFill(0xcccccc,100)
//樣式
anchorOne.lineStyle(0,0x000000,100,false,false,"none","miter",2)
//調(diào)用函數(shù)繪制成正方形
createSquare(anchorOne,8,-8)
//調(diào)用后方可拖動(dòng)
setDraggable(anchorOne)
//另一個(gè)描點(diǎn)
anchorTwo=createEmptyMovieClip("anchorPoint2",this.getNextHighestDepth())
anchorTwo._x=anchorTwo._y=250
anchorTwo.beginFill(0xcccccc,100)
anchorTwo.lineStyle(0,0x000000,100,false,false,"none","miter",2)
createSquare(anchorTwo,8,-8)
setDraggable(anchorTwo)
//控制點(diǎn)
controlOne=createEmptyMovieClip("control1",this.getNextHighestDepth())
controlOne._x=anchorTwo._x
controlOne._y=anchorOne._y
controlOne.beginFill(0xcccccc,100)
controlOne.lineStyle(0,0x000000,100,false,false,"none","miter",2)
createSquare(controlOne,8,-8)
setDraggable(controlOne)
//最后讓線條一開(kāi)始就顯示出來(lái)
connect()
復(fù)制粘貼就有效果。

分享:Flash AS實(shí)例教程:用純AS制作火焰特效
首先申明不是偶原創(chuàng),偶只是把效果綜合了一下。粒子變幻效果忘記是誰(shuí)的了,知道出處的朋友請(qǐng)?zhí)嵝眩荚谝院笱a(bǔ)上�;鹧嫒鹆餍Ч莵�(lái)自一位朋友的博客里面的攝像

來(lái)源:閃吧論壇//所屬分類(lèi):Flash教程/更新時(shí)間:2008-03-05
相關(guān)Flash教程